Name: dgC58589 Date: 01/12/98
SimpleDateFormat simple = new SimpleDateFormat("MM/dd/yyyy HH:mm");
System.out.println(simple.getTimeZone().getID());
results in "PST" (I am in CST)
(Review ID: 23044)
======================================================================
1998-01-14 Bob Schwenk ###@###.###
import java.lang.* ;
import java.text.* ;
import java.util.* ;
import timeUtilities.* ;
class TestTimeFormat
{
public TestTimeFormat ()
{
}
public static void main (String args[])
{
Time t = new Time (args[0]) ;
Calendar c = Calendar.getInstance() ;
UTCDate d = t.toDate() ;
c.set (d.year, d.month-1, d.day, d.hour, d.minute,
(int) (Math.round (d.second))) ;
Date javad = c.getTime() ;
System.out.println ("java Date = " + javad) ;
SimpleDateFormat sdf = new SimpleDateFormat (args[1]) ;
System.out.println ("formatted Date = " + sdf.format(javad)) ;
}
}
SAMPLE OUTPUT:
java Date = Fri Jan 09 00:00:00 EST 1998
formatted Date = 1998-01-09-21-00-00