Skip Menu |

This queue is for tickets about the Time-Piece CPAN distribution.

Report information
The Basics
Id: 65702
Status: rejected
Priority: 0/
Queue: Time-Piece

People
Owner: Nobody in particular
Requestors: IVSOKOLOV [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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";
This use of globals is likely to lead to spook action at a distance. I suggest subclassing Time::Piece and wrapping the method to have a different default. -- rjbs