Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

SimpleDateFormat parse changes time zone

Thread view: 
brisco5@gmail.com - 07 Jun 2007 22:18 GMT
I'm running into a bizarre problem that appears to only occur in
WebLogic.
Here's the code I'm using:

SimpleDateFormat sdf = new SimpleDateFormat("d MMM yyyy hh:mm:ss a z",
Locale.getDefault());

Date lDate = sdf.parse("30 Oct 2007 12:00:00 AM EDT");

lDate, however, will equal Mon Oct 29, 23:00:00 EST 2007

This only occurs for certain dates.  I've found it happening from
October 28th through November 4th, but that's not set in stone.
It seems like the parser is changing the time zone from EDT to EST,
which sets the time back an hour, which ends up rolling the day back
one.

This doesn't seem to happen in Webpshere or Tomcat.
I'm baffled.

Any ideas?
Lew - 08 Jun 2007 02:31 GMT
> I'm running into a bizarre problem that appears to only occur in
> WebLogic.
[quoted text clipped - 17 lines]
>
> Any ideas?

Which JVM is it using?  Maybe it's not been patched for the Daylight Saving
Time change.

<http://java.sun.com/developer/technicalArticles/Intl/tzupdatertool.html>

Signature

Lew

brisco5@gmail.com - 08 Jun 2007 13:23 GMT
> bris...@gmail.com wrote:
> > I'm running into a bizarre problem that appears to only occur in
[quoted text clipped - 26 lines]
> --
> Lew

JDK 1.4.2_11.  I'm using the same JDK in my local environment without
any problems.  We're using the same JDK against Websphere and Tomcat
with no problems.
"What does baffled mean?"


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.