P
Paul J. Lucas
Given:
SimpleDateFormat df = new SimpleDateFormat( "yyyy:MM:dd HH:mm:ss" );
String s = "2007:02:04 19:29:50";
Date d = df.parse( s );
what I want to happen is that, since the date format does not contain a
timezone, I want it to be taken to be in the host's local timezone. I am in the
Pacific timezone with daylight savings time in effect. Yet when I print d using
Date.toString(), I get:
Sun Feb 04 19:29:50 PST 2007
Why is it PST? It should be PDT. The result of:
TimeZone.getDefault().useDaylightTime()
is true. How do I fix this so that daylight savings time is correctly taken
into account?
- Paul
SimpleDateFormat df = new SimpleDateFormat( "yyyy:MM:dd HH:mm:ss" );
String s = "2007:02:04 19:29:50";
Date d = df.parse( s );
what I want to happen is that, since the date format does not contain a
timezone, I want it to be taken to be in the host's local timezone. I am in the
Pacific timezone with daylight savings time in effect. Yet when I print d using
Date.toString(), I get:
Sun Feb 04 19:29:50 PST 2007
Why is it PST? It should be PDT. The result of:
TimeZone.getDefault().useDaylightTime()
is true. How do I fix this so that daylight savings time is correctly taken
into account?
- Paul