- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Get localized day name in Java
The following is an example.
Example
import java.util.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; public class Demo { public static void main(String[] args) throws Exception { Date d = new Date(); DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss a"); String format = dateFormat.format(d); System.out.println("Current date and time = " + format); System.out.printf("Localized day name = %tA/%TA
", d, d); } }
Output
Current date and time = 26/11/2018 11:44:44 AM Localized day name = Monday/MONDAY
- Related Articles
- Get localized short day-in-week name in Java
- Display localized month name with printf method in Java
- Java Program to get full day name
- Java Program to get display name for Day of Week in different locale
- How to get day name from timestamp in MySQL?
- Get day name for the corresponding date in MySQL?
- Get Day Number of Week in Java
- Get the last day of month in Java
- Display Day Name of Week using Java Calendar
- Get file extension name in Java
- Java Program to display date with day name in short format
- Java Program to get day of week for the last day of each month in 2019
- Java Program to get day of week as string
- Get the day of week for a particular date in Java
- How to get current day, month and year in Java 8?

Advertisements