Dateformat Example

Java Date format: The Java Dateformat class is used to format the date/time in Java applications.

Ads

Tutorials   
 
 

Share on Google+Share on Google+

Dateformat Example

Ads

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

Advertisements

Ads

Posted on: April 3, 2006 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Related Tutorials