| 1 | package DateTime::Format::XSD; | ||
| 2 | # ABSTRACT: Format DateTime according to xsd:dateTime | ||
| 3 | |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use base qw(DateTime::Format::ISO8601); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | our $VERSION = '0.5'; | |
| 8 | |||
| 9 | 1 | ▶ | sub format_datetime { |
|
Subroutine
format_datetime: called CC=1 SCAR=0.0
Pod
documented
| |||
| 10 | 1 | my ($format, $date) = @_; | |
| 11 | 1 | my $out = $date->strftime('%FT%T%z'); | |
| 12 | 1 | $out =~ s/(\d\d)$/:$1/; | |
| 13 | 1 | return $out; | |
| 14 | }; | ||
| 15 | 1 | 1; | |
| 16 | |||
| 17 | __END__ | ||