Error in datestr.m in Octave-3.2.0 MingW

John W. Eaton jwe at octave.org
Tue Jun 23 19:27:06 CDT 2009


On 24-Jun-2009, Michael Goffioul wrote:

| On Tue, Jun 23, 2009 at 11:14 PM, John W. Eaton<jwe at octave.org> wrote:
| > On 23-Jun-2009, Philip Nienhuis wrote:
| >
| > | Digging a bit further, and echoeing strftime's arguments, i.e. variable:
| > | - df
| > | and expression:
| > | - localtime(mktime(tm))
| > | in the erroneous datestr.m, I see:
| >
| > Then maybe the bug is in mktime or localtime?  What are the values of
| > tm and mktime (tm) here?  I expect
| 
| >  tm =
| >  {
| >    year =  69
| >    mon = 0
| >    mday =  1
| >    hour = 0
| >    min = 0
| >    sec = 0
| >    usec = 0
| >  }
| >
| > and
| >
| >  ans = -31518000
| >
| > If these are not the values returned, then what does
| >
| >  localtime (-31518000)
| >
| > return on your Windows system?
| 
| ans =
| {
|   usec = 0
|   sec = 0
|   min = 0
|   hour = 0
|   mday = 0
|   mon = 0
|   year = 0
|   wday = 0
|   yday = 0
|   isdst = 0
|   zone = unknown
| }

Can you also send the values of tm and mktime (tm) that are computed
in datestr (datenum (1969, 1, 1))?

I'd be happy to have replacements for broken versions of mktime and/or
localtime and a configure test to determine when we should use them...

jwe



More information about the Bug-octave mailing list