| | 807 | |
| | 808 | =head1 NAME |
| | 809 | |
| | 810 | DateTime::Lite - A Low Calorie DateTime |
| | 811 | |
| | 812 | =head1 SYNOPSIS |
| | 813 | |
| | 814 | use DateTime::Lite; |
| | 815 | |
| | 816 | my $dt = DateTime::Lite->new(year => 2008, month => 12, day => 1); |
| | 817 | $dt->year; |
| | 818 | $dt->month; |
| | 819 | $dt->day; |
| | 820 | $dt->hour; |
| | 821 | $dt->minuute; |
| | 822 | $dt->second; |
| | 823 | |
| | 824 | # Arithmetic doesn't come with DateTime::Lite by default |
| | 825 | use DateTime::Lite qw(Arithmetic); |
| | 826 | $dt->add( DateTime::Liate::Duration->new(days => 5) ); |
| | 827 | |
| | 828 | =head1 DESCRIPTION |
| | 829 | |
| | 830 | This is a complete rip-off of the great DateTime module. The code's greatnes owes everything to its author(s). |
| | 831 | |
| | 832 | However, this module was conceived out of a few specific desires : |
| | 833 | |
| | 834 | (1) Reduce the amount of memory consumed |
| | 835 | (2) Make it easy to install on rental servers |
| | 836 | (3) Bundle everything in one distribution, including timezones |
| | 837 | |
| | 838 | To achieve this, we've taken the original DateTime and rearranged it as follows: |
| | 839 | |
| | 840 | =over 4 |
| | 841 | |
| | 842 | =item DateTime::Lite is Pure Perl |
| | 843 | |
| | 844 | No XS, pronto. Since we expect the audience to be people who are not sysadmins, we don't expect them to have a full compiler support either. |
| | 845 | |
| | 846 | =item Parameter validation is done by hand |
| | 847 | |
| | 848 | Params::Validate is a great module, but it slows things down. We don't see the merit of removing it from the original DateTime.pm, but we did so in this version. |
| | 849 | |
| | 850 | =item Non-essential methods are loaded on demand |
| | 851 | |
| | 852 | A lot of times you don't even need to do date time arithmetic, for example. These methods are separated out onto a different file, so you need to load it on demand. |
| | 853 | |
| | 854 | use DateTime::Lite qw(Arithmetic); |
| | 855 | |
| | 856 | =item DateTime::Lite::TimeZone and DateTime::Lite::Locale are not singletons |
| | 857 | |
| | 858 | Singletons are okay, they serve a particular purpose. But besides being a memory hog of relative low benefit, when given the number of time zones are locales, they are just way too overwhelming for underlings. |
| | 859 | |
| | 860 | With this version, the objects are mostly the just plain objects, and the exact definition for each timezone/locale is stored in YAML files. They can be located anywhere DateTime::Lite can find. |
| | 861 | |
| | 862 | In fact, we don't even bundle most of the timezones/locale that come with their respective sources. I only use Asia/Tokyo, if you live in US, you probably use about 5 at most. If you want more timezones, come grab them from http://tbd, and place it somewhere of your choice and set the appropriate environmental variables. DateTime::Lite will find it out. |
| | 863 | |
| | 864 | =back |
| | 865 | |
| | 866 | =cut |