[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strptime() inconsistency
From: |
Ben Abbott |
Subject: |
Re: strptime() inconsistency |
Date: |
Sat, 06 Mar 2010 15:14:32 +0900 |
On Mar 3, 2010, at 3:44 PM, Ben Abbott wrote:
> I've noticed that behavior of strptime() is not consistent for me on MacOS X.
>
> Running the MacOS X binary for 3.2.3 from OctaveForge
>
> fmt = "%d-%b-%Y";
> str = "17-Sep-1789";
> [tm, nc] = strptime (str, fmt)
>
> tm =
> {
> usec = 0
> sec = 0
> min = 0
> hour = 0
> mday = 17
> mon = 8
> year = 89
> wday = 0
> yday = 259
> isdst = 0
> zone = JST
> }
>
> nc = 12
>
> However, the 3.2.3 binary I built using gcc 4.4.2, I obtain the result below.
> When I build the current sources using gcc 4.2.1, I also see the result below.
>
> tm =
> {
> usec = 0
> sec = 0
> min = 0
> hour = 0
> mday = 17
> mon = 8
> year = 0
> wday = 0
> yday = 0
> isdst = 0
> zone = unknown
> }
>
> nc = 0
>
> This problem only occurs for dates prior to 01-Jan-1900.
>
> Does anyone have an idea what might be the cause of this inconsistent
> behavior?
>
> Ben
I noticed the MacOS X has its own strptime.
http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man3/strptime.3.html
Can someone tell me how I may determine if Octave is calling the version from
gnulib or the one included with MacOS X?
Ben