Solved

time format affected by time switching?!

Posted on 2006-10-30
7
1,084 Views
Last Modified: 2008-01-09
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
Comment
Question by:TheSilverBullet
  • 4
  • 3
7 Comments
 
LVL 24

Expert Comment

by:sciuriware
Comment Utility
Set the timezone to GMT or UTC, that's without daylight saving time.

;JOOP!
0
 

Author Comment

by:TheSilverBullet
Comment Utility
I have set it to GMT but it returns one hour less!!!
0
 
LVL 24

Expert Comment

by:sciuriware
Comment Utility
Less than what?

;JOOP!
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:TheSilverBullet
Comment Utility
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
 
LVL 24

Accepted Solution

by:
sciuriware earned 50 total points
Comment Utility
Then set it to GMT+1 (C-EUROPE): you'll get what you set for.

;JOOP!
0
 

Author Comment

by:TheSilverBullet
Comment Utility
I know, but what if the tool will be used in japan later on? this will give wrong results , wont it?
0
 
LVL 24

Expert Comment

by:sciuriware
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sumHeights2  challenge 7 75
Books that can get me started on JAVA 2 52
strCount chalenge 3 50
JAVA part two 5 39
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now