Date issue Win98 vs NT

drs drs at ecp.cc
Wed Jul 2 03:44:57 EDT 2003


"Stan Cook" <scook at elp.rr.com> wrote in message
news:SDsMa.38974$hV.2346862 at twister.austin.rr.com...
> 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.


maybe localtime() will work better than gmtime()?  could be a missetting
somewhere?

not the help you are looking for, but try

import os.path
os.path.join(_log, '%s.log' % strftime("%m%d%y", gmtime()))

or even

_log += ('\\%s.log' % strftime("%m%d%y", gmtime()))

to get rid of some of the + signs.

-d






More information about the Python-list mailing list