Lines 54-59
sub reset_prefformat { # subroutine to clear the prefformat, called when we cha
Link Here
|
54 |
our %format_map = ( |
54 |
our %format_map = ( |
55 |
iso => 'yyyy-mm-dd', # plus " HH:MM:SS" |
55 |
iso => 'yyyy-mm-dd', # plus " HH:MM:SS" |
56 |
metric => 'dd/mm/yyyy', # plus " HH:MM:SS" |
56 |
metric => 'dd/mm/yyyy', # plus " HH:MM:SS" |
|
|
57 |
dol => 'dd.mm.yyyy', |
57 |
us => 'mm/dd/yyyy', # plus " HH:MM:SS" |
58 |
us => 'mm/dd/yyyy', # plus " HH:MM:SS" |
58 |
sql => 'yyyymmdd HHMMSS', |
59 |
sql => 'yyyymmdd HHMMSS', |
59 |
rfc822 => 'a, dd b y HH:MM:SS z ', |
60 |
rfc822 => 'a, dd b y HH:MM:SS z ', |
Lines 61-66
our %format_map = (
Link Here
|
61 |
our %posix_map = ( |
62 |
our %posix_map = ( |
62 |
iso => '%Y-%m-%d', # or %F, "Full Date" |
63 |
iso => '%Y-%m-%d', # or %F, "Full Date" |
63 |
metric => '%d/%m/%Y', |
64 |
metric => '%d/%m/%Y', |
|
|
65 |
dol => '%d.%m.%Y', |
64 |
us => '%m/%d/%Y', |
66 |
us => '%m/%d/%Y', |
65 |
sql => '%Y%m%d %H%M%S', |
67 |
sql => '%Y%m%d %H%M%S', |
66 |
rfc822 => '%a, %d %b %Y %H:%M:%S %z', |
68 |
rfc822 => '%a, %d %b %Y %H:%M:%S %z', |
Lines 70-75
our %dmy_subs = ( # strings to eval (after using regular ex
Link Here
|
70 |
# make arrays for POSIX::strftime() |
72 |
# make arrays for POSIX::strftime() |
71 |
iso => '[(($6||0),($5||0),($4||0),$3, $2 - 1, $1 - 1900)]', |
73 |
iso => '[(($6||0),($5||0),($4||0),$3, $2 - 1, $1 - 1900)]', |
72 |
metric => '[(($6||0),($5||0),($4||0),$1, $2 - 1, $3 - 1900)]', |
74 |
metric => '[(($6||0),($5||0),($4||0),$1, $2 - 1, $3 - 1900)]', |
|
|
75 |
dol => '[(($6||0),($5||0),($4||0),$1, $2 - 1, $3 - 1900)]', |
73 |
us => '[(($6||0),($5||0),($4||0),$2, $1 - 1, $3 - 1900)]', |
76 |
us => '[(($6||0),($5||0),($4||0),$2, $1 - 1, $3 - 1900)]', |
74 |
sql => '[(($6||0),($5||0),($4||0),$3, $2 - 1, $1 - 1900)]', |
77 |
sql => '[(($6||0),($5||0),($4||0),$3, $2 - 1, $1 - 1900)]', |
75 |
rfc822 => '[($7, $6, $5, $2, $3, $4 - 1900, $8)]', |
78 |
rfc822 => '[($7, $6, $5, $2, $3, $4 - 1900, $8)]', |
Lines 81-87
our @days = qw(Sun Mon Tue Wed Thu Fri Sat);
Link Here
|
81 |
|
84 |
|
82 |
sub regexp ($;$) { |
85 |
sub regexp ($;$) { |
83 |
my $self = shift; |
86 |
my $self = shift; |
84 |
my $delim = qr/:?\:|\/|-/; # "non memory" cluster: no backreference |
87 |
my $delim = qr/:?\:|\/|-|\./; # "non memory" cluster: no backreference |
85 |
my $format = (@_) ? _recognize_format(shift) : ( $self->{'dateformat'} || _prefformat() ); |
88 |
my $format = (@_) ? _recognize_format(shift) : ( $self->{'dateformat'} || _prefformat() ); |
86 |
|
89 |
|
87 |
# Extra layer of checking $self->{'dateformat'}. |
90 |
# Extra layer of checking $self->{'dateformat'}. |