Date issue Win98 vs NT

S

Stan Cook

Has anyone else had this or a similar problem and is there a workaround?

This piece of code:

from time import gmtime, strftime
_log = _log + "\\" + strftime("%m%d%y", gmtime()) + ".log"

produces a file with the name 'today's date.log' on NT, but creates a file
called 'tomorrow's date.log' on Windows 98. I would really like to know
why this happens. Any help offered is very much appreciated.

Thanks,

Stan
 
C

Christos TZOTZIOY Georgiou

Has anyone else had this or a similar problem and is there a workaround?
This piece of code:
from time import gmtime, strftime
_log = _log + "\\" + strftime("%m%d%y", gmtime()) + ".log"
produces a file with the name 'today's date.log' on NT, but creates a file
called 'tomorrow's date.log' on Windows 98. I would really like to know
why this happens. Any help offered is very much appreciated.

Are you by any chance in Austin, Texas?

I could guess that first you tried this code in Windows NT, and later
rebooted to Windows 98. Running your code on Windows 98 happened after
6pm, your local time.

By that time, I think it is already tomorrow in Greenwich, England
(which is what gmtime provides). Try localtime instead (assuming your
timezone is set correctly both in NT and 98).
 
S

Stan Cook

Thanks!! You were right on with that one. I've been working on the program
at home and work. At work with NT and 98 at home. I changed all of the
gmtime references to localtime and everything came out correct.

Thanks again....

Stan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top