Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

schwern (1528)

  (email not shown publicly)
AOL IM: MichaelSchwern (Add Buddy, Send Message)

Schwern can destroy CPAN at his whim.

Journal of schwern (1528)

Wednesday September 17, 2008
06:11 PM

Small task for a Russian/Chinese/Eastern European computer

[ #37475 ]

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)'


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.


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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • The ad at the top of this page is for Russian "dating." WTF. Someone complain to the site operator.

  • [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
  • 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