File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Time zone problem in date format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Time zone problem in date format" Watch "Time zone problem in date format" New topic

Time zone problem in date format

Bhupinder Dhillon
Ranch Hand

Joined: Oct 12, 2000
Posts: 124
Why does the following code produces different output on solaris with time zone set to 'TZ=Canada/Mountain':
When run in JDK 1.2.2
Date: Wed, 09 Jul 2003 13:06:44 GMT-06:00
and in 1.3.1_02
Date: Wed, 09 Jul 2003 12:06:25 MDT
Here's the code:

[ July 09, 2003: Message edited by: Bhupinder Dhillon ]
Jason Menard

Joined: Nov 09, 2000
Posts: 6450
I'm going to move this to Java in General - Intermediate.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
It is a bug that has been fixed and closed.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
It is sorta covered in the JavaRanch Style Guide.
subject: Time zone problem in date format
Similar Threads
Time Zone Z associated with date
plz help with Calendar doubt.. ;-)
Date printed in IST format when EDT format required
Comparing two dates
Can't parse dates with full zone name