|
|
SimpleDateFormat parse changes time zone
I'm running into a bizarre problem that appears to only occur inWebLogic.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 2007This only occurs for certain dates. I've found it happening fromOctober 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 backone.This doesn't seem to happen in Webpshere or Tomcat.I'm baffled.Any ideas?
|
|
0
|
|
|
|
Reply
|
brisco5 (4)
|
6/7/2007 9:18:31 PM |
|
brisco5@gmail.com wrote:
> 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?
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>
--
Lew
|
|
0
|
|
|
|
Reply
|
Lew
|
6/8/2007 1:31:30 AM
|
|
On Jun 7, 9:31 pm, Lew <l...@noemail.lewscanon.com> wrote:
> bris...@gmail.com wrote:
> > 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?
>
> 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>
>
> --
> 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?"
|
|
0
|
|
|
|
Reply
|
brisco5
|
6/8/2007 12:23:57 PM
|
|
|
2 Replies
462 Views
(page loaded in 0.046 seconds)
|
|
|
|
|
|
|
|
|