Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date time

Status
Not open for further replies.

cdlvj

MIS
Nov 18, 2003
676
0
0
US
This is a windows box with Active Perl. I cannot get the correct time. Have been using localtime. TZ is set to CST6CDT.

It always return 1 hour less. Tried Date::manip same thing.
Remove TZ, tried everything.
Any ideas?
Thanks in advance.
 
Does windows itself show the correct time?

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
yes it does, The process creates files with correct date.

But the localtime returns date 1 hour off.
 
is the timezone checkbox checked or has someone manually changed the time on the machine?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
If windows has the correct time, and localtime does not, you need to check your perl script and see where the time is getting changed. Perl just uses the system clock (as far as I know) so localtime should agree with the system clock.

It almost sounds like a daylight savings time problem but I am not sure why it would be a problem.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
I know we have had problems when the TZ was set to somewhere that you wouldn't think supported DST (normal GMT London for example) but the "automatically adjust for DST" button was checked. The machine/file times where correct but all the applications kept getting the wrong time (so every timestamp the applications wrote out was wrong). They were taking GMT and then compensating for the DST check box. We have since changed all the windows servers to GMT Monrovia which doesn't even supply the DST check box :)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top