DateTimeX::Lite

| コメント(0) | トラックバック(0)
わすれてた。昨日DateTimeX::Liteをアップしてた。
use DateTimeX::Lite; my $dt = DateTimeX::Lite->new(year => 2008, month => 12, day => 1); $dt->year; $dt->month; $dt->day; $dt->hour; $dt->minuute; $dt->second; # Arithmetic doesn't come with DateTimeX::Lite by default use DateTimeX::Lite qw(Arithmetic); $dt->add( DateTime::Liate::Duration->new(days => 5) ); # Strftime doesn't come with DateTimeX::Lite by default use DateTimeX::Lite qw(Strftime); $dt->strftime('%Y %m %d');
だいたいDateTimeと互換性のあるAPIで、ただPurePerlであるところと、とにかくlazyに色々ロードするようにしてある。TimeZoneとLocaleは全部一緒に入ってて、なおかつdo 'timezone.dat'みたいな感じで呼び出してるから大分高速。
あとはTimeZoneとかは一緒にバンドルしててもどうせ全部なんて使わないから、必要な分だけをあとからインストールできるようにしたいな、と。

Author

Daisuke Maki (a.k.a lestrrat): Perl hacker, Director of Japan Perl Association, YAPC::Asia Tokyo Organizer (2009-2012), Fluent in Japanese, English. Ex-Brazilian (sorta)

#perl #c #ruby #java #mysql #english #japanese #opensource #stf #cooking #scotch #cigar


このエントリーをはてなブックマ
ークに追加

翔泳社よりモダンPerl入門(2010)を出版させていただいております。できれば内容をアップデートしたいので是非皆様・・・現在の在庫処理にお力をお貸しください!><

月別アーカイブ