Small task for a Russian/Chinese/Eastern European computer

schwern on 2008-09-17T23:11:50

I'm trying to determine if localtime() should always follow the Gregorian calendar or not. The C99 spec is not clear on this (it's clear that gmtime() is always Gregorian) and POSIX doesn't seem to bring it up.

I could just change the time zone on my own machine, but I don't trust that will really give an accurate representation. What I want is someone to run localtime() on a Unix distribution specifically designed for and by Russians, Eastern Europeans or Chinese. These all changed from Julian to Gregorian in the last 100 years, inside the range of 32 bit localtime().

So if someone with a machine like that could run:

perl -wle 'print scalar localtime(-2**30-2**29-2**28)'


and

perl -wle 'print scalar localtime(-2**30)'


and let me know the result (and what Unix dist you're using and time zone you're in) that would give me some data points.

Thanks.

PS Don't use my patched bleadperl for this. :)


use D'oh;

pudge on 2008-09-18T05:42:49

The ad at the top of this page is for Russian "dating." WTF. Someone complain to the site operator.

Chinese Standard Time

mr_bean on 2008-09-20T13:16:51

[drbean@localhost dic]$ date 六 9月 20 21:06:45 CST 2008 [drbean@localhost dic]$ perl -wle 'print scalar localtime(-2**30-2**29-2**28)' Fri Jun 17 02:10:08 1910 [drbean@localhost dic]$ perl -wle 'print scalar localtime(-2**30)' Mon Dec 23 18:22:56 1935

Fedora 9. LANG=zh_TW.UTF-8

Re:Chinese Standard Time

schwern on 2008-09-21T08:01:30

Thanks, but I don't trust Fedora to get it right. Maybe Red Flag Linux?

From Russia

kappa on 2008-09-28T23:28:58

Russia's here. Ubuntu 8.04 with russian locale (ru_RU.UTF-8), time zone "Europe/Moscow" (UTC+3/4).

% perl -wle 'print scalar localtime(-2**30-2**29-2**28)' Thu Jun 16 20:40:08 1910

% perl -wle 'print scalar localtime(-2**30)' Mon Dec 23 13:22:56 1935

Re:From Russia

kappa on 2008-09-28T23:30:05

Sorry about forgetting to format.