2005年3月16日水曜日

Class::Dateで扱えるのは1902年から2038年まで

search.cpan.org: Class::Date - Class for easy date and time manipulation

Class::Dateに「1900-01-01」を渡すとなぜか2038年になってしまうのでドキュメントを見直すとBUGS AND LIMITATIONSのセクションに以下の記述がありました。

>
This module uses the POSIX functions for date and time calculations, so it is not working for dates beyond 2038 and before 1902.
I don't know what systems support dates in 1902-1970 range, it may not work on your system. I know it works on the Linux glibc system with perl 5.6.1 and 5.7.2. I know it does not work with perl 5.005_03 (it may be the bug of the Time::Local module). Please report if you know any system where it does _not_ work with perl 5.6.1 or later.
I hope that someone will fix this with new time_t in libc. If you really need dates over 2038 and before 1902, you need to completely rewrite this module or use Date::Calc or other date modules.
<

時間関係はTime::Pieceを使った方がいいかも。


0 件のコメント:

コメントを投稿