octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #54193] [MXE-Octave] libinterp/corefcn/time.cc


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #54193] [MXE-Octave] libinterp/corefcn/time.cc-tst failure when test suite is run twice
Date: Thu, 28 Jun 2018 12:35:39 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #2, bug #54193 (project octave):

This appears to be a timezone problem.  See also bug #53909 and bug #53916.

It seems that datenum sets the timezone to UTC and mktime sets it to the
timezone set for the system.  When the timezone changes, localtime also shows
a different value for the hour field, as I think it should.  I haven't tried
to understand why the mktime function then produces a different result
compared to the original value returned from the time function given that the
hour value is changed along with the timezone.

In any case, here is what I see:


>> t = time ();
>> localtime (t)
ans =

  scalar structure containing the fields:

    usec =  847215
    sec =  2
    min =  50
    hour =  8
    mday =  28
    mon =  5
    year =  118
    wday =  4
    yday =  178
    isdst =  1
    gmtoff = 0
    zone = Pacific Daylight Time

>> datenum ("5/19/2001")
ans =  730990
>> localtime (t)
ans =

  scalar structure containing the fields:

    usec =  847215
    sec =  2
    min =  50
    hour =  15
    mday =  28
    mon =  5
    year =  118
    wday =  4
    yday =  178
    isdst = 0
    gmtoff = 0
    zone = UTC

>> mktime (localtime (t))
ans =  1530229802.84721
>> localtime (t)
ans =

  scalar structure containing the fields:

    usec =  847215
    sec =  2
    min =  50
    hour =  8
    mday =  28
    mon =  5
    year =  118
    wday =  4
    yday =  178
    isdst =  1
    gmtoff = 0
    zone = Pacific Daylight Time



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?54193>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]