strftime#
Format a broken-down time as a string using a format template.
Σύνοψη#
use POSIX qw(strftime);
my @tm = localtime;
my $str = strftime("%Y-%m-%d %H:%M:%S", @tm);
Τι επιστρέφεται#
A byte string formatted according to the template. Argument order matches localtime / gmtime: second, minute, hour, mday, mon (0-11), year (years since 1900), wday, yday, isdst - the last three optional and defaulting to -1.
Οριακές περιπτώσεις#
Fewer than seven arguments (format plus the first six tm fields): returns the empty string.
Output truncated at 1024 bytes.
Month is 0-11 and year is years-since-1900, the
struct tmconvention, not the 1-12 / 4-digit-year human convention.
Διαφορές από το upstream#
Fully compatible with upstream POSIX.
Δείτε επίσης#
mktime- go the other way: broken-down time → epoch seconds.asctime,ctime- simpler canned-format alternatives.