public
Description:
Homepage:
Clone URL: git://github.com/robertkrimen/datetimex-easy.git
datetimex-easy / _test.pl
100755 27 lines (19 sloc) 0.884 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl -w
 
use strict;
 
use DateTime;
use DateTimeX::Easy qw/datetime/;
 
my $dt = DateTime->from_epoch(epoch => time, time_zone => "local");
warn $dt->time_zone->name;
 
 
print datetime("first day of last month"), "\n";
print datetime("last day of last month"), "\n";
print datetime("last second of first month of last year"), "\n";
print datetime("last second of first month of year of 2005"), "\n";
print datetime("last second of last month of year of 2005"), "\n";
 
print datetime("beginning day of month of 2007-10-02"), "\n";
print datetime("end day of month of 2007-10-02"), "\n";
print datetime("last month of year of 2007"), "\n";
 
print datetime("last month of 2007"), "\n";
print datetime("end day of 2007-10-02"), "\n";
print datetime("beginning day of 2007-10-02"), "\n";
print datetime("last day of 2007"), "\n";
print datetime("last day of year of 2007"), "\n";