package com.mindprod.example;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
/**
* Display Today's date
* <p/>
* composed with IntelliJ IDEA
*
* @author Roedy Green, Canadian Mind Products
* @version 1.0, 2006-03-02
*/
public final class TestToday
{
/**
* ISO format YYYY-MM-DD, could use other masks.
*/
private static final SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd" );
/**
* Display current date e.g. 2006-01-22
*
* @param args not used
*/
public static void main( String[] args )
{
TimeZone local = TimeZone.getDefault();
sdf.setTimeZone( local );
String dateString = sdf.format( new Date() );
System.out.println( dateString );
String timeZoneName = local.getDisplayName();
System.out.println( timeZoneName );
}
}