- 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
Java Program to display date with day name in short format
Firstly, set the format with SimpleDateFormat class
Format dateFormat = new SimpleDateFormat("EEE, dd/MM/yyyy");
Above, the “EEE” is set to display the name of the day i.e. Monday, Tuesday, Wednesday, etc.
Now, to display the date −
String res = dateFormat.format(new Date());
The following is an example −
Example
import java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; public class Demo { public static void main(String[] argv) throws Exception { Format dateFormat = new SimpleDateFormat("EEE, dd/MM/yyyy"); String res = dateFormat.format(new Date()); System.out.println("Date = " + res); } }
Output
Date = Thu, 22/11/2018
- Related Articles
- Short Length format for Date with Java MessageFormat class
- Java Program to format date with SimpleDateFormat
- Java Program to format date with DateFormat.FULL
- Java Program to format date with System.out.format
- Java Program to format date time with Join
- Short Date ("d") Format Specifier
- Get localized short day-in-week name in Java
- Format date to display month names with the entire date in MySQL?
- Java Program to get display name for Day of Week in different locale
- Java Program to parse string date value with default format
- Java Program to format date in mm-dd-yyyy hh:mm:ss format
- How to format and display date in Java as '201904'
- Program to convert Milliseconds to Date Format in Java
- Format date with DateFormat.MEDIUM in Java
- Format date with DateFormat.LONG in Java

Advertisements