Error in datestr.m in Octave-3.2.0 MingW

John W. Eaton jwe at octave.org
Wed Jun 24 09:37:19 CDT 2009


On 24-Jun-2009, Michael Goffioul wrote:

| On Wed, Jun 24, 2009 at 7:35 AM, Michael
| Goffioul<michael.goffioul at gmail.com> wrote:
| > On Wed, Jun 24, 2009 at 1:27 AM, John W. Eaton<jwe at octave.org> wrote:
| >> 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...
| >
| > octave:19> datestr(datenum(1969, 1, 1))
| > tm =
| > {
| >  year =  69
| >  mon = 0
| >  mday =  1
| >  hour = 0
| >  min = 0
| >  sec = 0
| >  usec = 0
| > }
| >
| > mktime(tm) = -1
| > ans = 00-Jan-1900
| >
| > Michael.
| >
| 
| The reason is there:
| http://msdn.microsoft.com/en-us/library/d1y53h2a(VS.80).aspx
| 
| For dates before epoch, mktime returns -1.

OK.  As it seems this is allowed by standard conforming
implementations, I think we need another solution if we are to support
dates prior to 1/1/1970.

jwe



More information about the Bug-octave mailing list