RSS Links

 

Here are all of the RSS links for sections of this site

VB.NET/ASP.NET
 Java
 Unix/Linux
 Windows
 SQL Server

Home arrow Java arrow Printing a formatted date in Java
Printing a formatted date in Java PDF Print E-mail
Sunday, 24 January 2010
Printing a date out in the certain format is easy in java - you need to use the SimpleDateFormat class - there is an example below


public void printFormattedDate()
{
        Date theDate = new GregorianCalendar().getTime();

        SimpleDateFormat format = new SimpleDateFormat(
                "EEE MMM dd HH:mm:ss zzz yyyy");
        System.out.println("The date formatted is " + format.format(theDate));

}
Last Updated ( Friday, 11 June 2010 )
 
< Prev   Next >
 
Designed by Graham Robinson Software