Solved

time format affected by time switching?!

Posted on 2006-10-30
7
1,095 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 24

Expert Comment

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

;JOOP!
0
 

Author Comment

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

Expert Comment

by:sciuriware
ID: 17840428
Less than what?

;JOOP!
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:TheSilverBullet
ID: 17840449
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
ID: 17840460
Then set it to GMT+1 (C-EUROPE): you'll get what you set for.

;JOOP!
0
 

Author Comment

by:TheSilverBullet
ID: 17840467
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
ID: 17840477
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

724 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