Discussions
EJB programming & troubleshooting: Problem when computing time difference when daylightTime changes
-
Problem when computing time difference when daylightTime changes (2 messages)
- Posted by: Muhammad Irshad
- Posted on: May 01 2007 13:25 EDT
Time in: 10:00 p.m. on 03/10/2007 at CST Time out: 05:00 a.m. on 03/11/2007 at CDT - because daylight start in 2007 on this date Hours worked differnce is comming 7 hours. Acaually it should be 6 hours, since at 2 a.m. on 03/11/2007 time changes to 1 a.m.. This problem is also when vice versa (when daylight time changes back to non-daylight savings) I mean the difference is 7 hours, but actually it should be 8 hours. Any help?????Threaded Messages (2)
- Re: Problem when computing time difference when daylightTime changes by Nicke G on May 02 2007 03:01 EDT
- Re: Problem when computing time difference when daylightTime changes by Muhammad Irshad on May 03 2007 09:48 EDT
-
Re: Problem when computing time difference when daylightTime changes[ Go to top ]
- Posted by: Nicke G
- Posted on: May 02 2007 03:01 EDT
- in response to Muhammad Irshad
You must use the underlying millisecond (Date.getTime()) representation to evaluate true elapsed time. Then re-work the millisecond time difference into hours and minutes. /Niklas -
Re: Problem when computing time difference when daylightTime changes[ Go to top ]
- Posted by: Muhammad Irshad
- Posted on: May 03 2007 09:48 EDT
- in response to Nicke G
It worked. Many thanks.