help-octave
[Top][All Lists]
Advanced

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

Re: date weirdness (Freebsd, octave 3.2.4)


From: Liam Groener
Subject: Re: date weirdness (Freebsd, octave 3.2.4)
Date: Thu, 25 Mar 2010 17:12:48 -0700

On Mar 25, 2010, at 1:26 AM, Michael Goffioul wrote:

> With the current development code compiled with MSVC,
> you get 01-Jan-1970 00:00:00 in both cases. I think this is
> at least partially related to how mktime (used internally by
> datestr) is implemented under Windows, see
> http://msdn.microsoft.com/en-us/library/d1y53h2a(VS.80).aspx
> 
> Michael.
> 
> 
> On Thu, Mar 25, 2010 at 2:30 AM, forkandwait <address@hidden> wrote:
>> Hi all,
>> 
>> I found a bug related to dates, but figured it is was only on the Windows
>> port.  However I am getting bad date behavior with datestr when it gets too 
>> old
>> (I know the feeling...).
>> 
>> My apologies if this is documented somewhere already.
>> 
>> octave-3.2.4:11:foodemog> datestr(now()- 30000)
>> ans = 03-Feb-1928 19:23:24
>> 
>> octave-3.2.4:12:foodemog> datestr(now()- 100000)
>> ans = 31-Dec-1969 16:00:00
>> 
>> Is this being fixed? Is fixed and is a freebsd issue?  A feature?
>> 
>> 
>> _______________________________________________
>> Help-octave mailing list
>> address@hidden
>> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>> 
> 
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Actually the problem is in the gnulib version of mktime that is used by 
Octave's datestr. The gnulib mktime only works for dates latter than 1902. I 
proposed a hack of datestr.m to get around this problem to the maintainers 
list, but got no response. I've attached a copy of the revised datestr.m in 
case you want to use it. By the way, datevec has the same problem.

Attachment: datestr.m
Description: Binary data


reply via email to

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