Home Blog 2008 11 24 Dateformat-example Dateformat Example

 
 

Dateformat Example
Posted on: April 3, 2006 at 12:00 AM
Advertisement
Java Date format: The Java Dateformat class is used to format the date/time in Java applications.

Dateformat Example

The Java Dateformat class is used to format the date/time in Java applications. You can use the Dateformat class while generating the report to format the date/time in required format.

To format a date for the current Locale, use one of the static factory methods:

String myString = DateFormat.getDateInstance().format(myDate);

DateFormat provides many class methods for obtaining default date/time formatters based on the default or a given locale and a number of formatting styles. The formatting styles include FULL, LONG, MEDIUM, and SHORT. More detail and examples of using these styles are provided in the method description.

Here is the example of Dateformat class:

Thanks

Advertisement

Related Tags for Dateformat Example:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 3, 2006

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com