Date issue Win98 vs NT

Discussion in 'Python' started by Stan Cook, Jul 2, 2003.

  1. Stan Cook

    Stan Cook Guest

    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
     
    Stan Cook, Jul 2, 2003
    #1
    1. Advertising

  2. On Wed, 02 Jul 2003 03:50:10 GMT, rumours say that "Stan Cook"
    <> might have written:

    >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).
    --
    TZOTZIOY, I speak England very best,
    Microsoft Security Alert: the Matrix began as open source.
     
    Christos TZOTZIOY Georgiou, Jul 2, 2003
    #2
    1. Advertising

  3. Stan Cook

    Stan Cook Guest

    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
    "Christos TZOTZIOY Georgiou" <> wrote in message
    news:...
    > On Wed, 02 Jul 2003 03:50:10 GMT, rumours say that "Stan Cook"
    > <> might have written:
    >
    > >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).
    > --
    > TZOTZIOY, I speak England very best,
    > Microsoft Security Alert: the Matrix began as open source.
     
    Stan Cook, Jul 3, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    610
    Matthew Speed
    Nov 8, 2003
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,285
    Michael Borgwardt
    May 30, 2004
  3. Matt
    Replies:
    2
    Views:
    522
    Pete Becker
    Nov 8, 2003
  4. Matt
    Replies:
    3
    Views:
    728
    Richard Heathfield
    Nov 8, 2003
  5. Matt
    Replies:
    11
    Views:
    409
    Aaron Bertrand [MVP]
    Nov 8, 2003
Loading...

Share This Page