• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1098
  • Last Modified:

time format affected by time switching?!

Hi,
I have this date format

simpleTimeFormat = new SimpleDateFormat("HH:mm:ss");
simpleTimeFormat.format( new Date(file.lastModified()) ).toString()

I get oddly the time increased automatically with 1 hour for a file before swithcing to new timing (before 29.10.06) !! how to prevent it from returning the time increased, ie to return exactly the time the file holds regardless of the winter or summer switching.
0
TheSilverBullet
Asked:
TheSilverBullet
  • 4
  • 3
1 Solution
 
sciuriwareCommented:
Set the timezone to GMT or UTC, that's without daylight saving time.

;JOOP!
0
 
TheSilverBulletAuthor Commented:
I have set it to GMT but it returns one hour less!!!
0
 
sciuriwareCommented:
Less than what?

;JOOP!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
TheSilverBulletAuthor Commented:
than before, the file modification time is 9:30 , before it was increased 1 hour more automatically, ie in the debugger it reads 10:30 , which is not correct , if I set the simple date format default zone to GMt I get 8:30
0
 
sciuriwareCommented:
Then set it to GMT+1 (C-EUROPE): you'll get what you set for.

;JOOP!
0
 
TheSilverBulletAuthor Commented:
I know, but what if the tool will be used in japan later on? this will give wrong results , wont it?
0
 
sciuriwareCommented:
That's a Microsoft problem solved by Bell Labs in 1969,
so UNIX (and derivates) and LINUX don't know this problem.
In Windows you're bound to always account for the timezone.

;JOOP!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now