Re: strptime cannot parse date older than 1938
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=/FexA7PHmYNsfHhgspFyamCYQ7+e9i/0KAhSN2SVoP4=; b=DYpeI3zFZA23z+iyuzIq0ozLdzkZV0ZDEFtNxrztZu979rW7jC9z+wgIshqTsyJ5wYQO187luuUxcU0dmKsi/Bp8qWIb3aG+XSPTIgYR48Kvzj4/SlCzQSOOEMH3HBGEurgmr2A8tgEImnx93rZWHp7h4u8DukRFN2dW0v7ByRw= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nu1bXSV3N2YR2ZO7PM90LCQh9SwCC74I97/DAMwHMK0MIsEXwkoV+9YzSfqGqRZdV9RtGXrZwqWDGDrqgPbrBPzRkBjq3N0k/lj5GRJ+vs/VVPiwDwvvsr6Ss2FgRtGnqNJZOHv3P7RD2zA6pM4Wt55uiRlV1Rj7Ta4VabnCZW8= It is 70 ,not 69. Almost(few such as 1,Jan,2038 is parsed correctly) date strings later than 2038 is parsed as 70. On Thu, Apr 24, 2008 at 2:28 PM, Steve Checkoway <s@pahtak.org> wrote:
On Apr 23, 2008, at 10:09 PM, Surf Chen wrote:
If the parsing date > certain date,the strptime dose not work like it on
linux.
On my debian box, the output is 138 but on Mac OSX,output is 70.
I really hope you mean 69.
The manpage(man 3 strptime) says:
Two-digit year values, including formats %y and %D, are now interpreted as beginning at 1969 per POSIX requirements. Years 69-00 are interpreted in the 20th century (1969-2000), years 01-68 in the 21st century (2001-2068).
Hmm, this seems like a bug. 69 is the number of years since 1969, but that field should be number of years since 1900, according to the man page ctime(3).
-- Steve Checkoway
"Anyone who says that the solution is to educate the users hasn't ever met an actual user." -- Bruce Schneier
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/surfchen%40gmail.com
This email sent to surfchen@gmail.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Surf Chen