Subject: | Add default format support to strftime |
strftime returns date in "%a, %d %b %Y %H:%M:%S $tzname" format by default.
When i use Time::Piece object in sting it convert to default format.
It would very helpfull if i can set default format.
Code would be minimized.
my $tm = localtime;
print "time " . $tm->strftime('%F %T');
# compare with next code
$Time::Piece::FORMAT = '%F %T';
my $tm = localtime;
print "time $tm";
Subject: | format.diff |
37,38d36
< our $FORMAT;
<
456c454
< my $format = @_ ? shift(@_) : $FORMAT || "%a, %d %b %Y %H:%M:%S $tzname";
---
> my $format = @_ ? shift(@_) : "%a, %d %b %Y %H:%M:%S $tzname";