资 源 简 介
NAME
DateTime::Format::Strptime - Parse and format strp and strf time patterns
SYNOPSIS
```
use DateTime::Format::Strptime;
my $Strp = new DateTime::Format::Strptime(
pattern => "%T",
locale => "en_AU",
time_zone => "Australia/Melbourne",
);
my $dt = $Strp->parse_datetime("23:16:42");
$Strp->format_datetime($dt);
# 23:16:42
Croak when things go wrong:
my $Strp = new DateTime::Format::Strptime(
pattern => "%T",
locale => "en_AU",
time_zone => "Australia/Melbourne",
on_error => "croak",
);
$newpattern = $Strp->pattern("%Q");
# Unidentified token in pattern: %Q in %Q at line 34 of script.pl
Do something else when things go wrong:
my $Strp = new DateTime::Format::Strptime(
pattern => "%T",
locale => "en_AU",
time_zone => "Australia/Melbourne",
on_error => &phone_police,
);
```