in reply to Types::DateTime, DateTimeUTC->plus_coercions( Format['ISO8601'] ), output format override question

$cowtime->timestamp is a DateTime object, so you could use the following:

$cowtime->timestamp->strftime("%Y-%m-%dT%H:%M:%S.%9N%z") =~ s/(?=..\z) +/:/sr

I'm not aware of any DateTime::Format::* class that would produce the format you want. If there was you could set it as the default format (used for stringification) using the following:

use DateTime::Format::Foo qw( ); my $format = DateTime::Format::Foo->new(...); $cowtime->timestamp->set_formatter($format);
  • Comment on Re: Types::DateTime, DateTimeUTC->plus_coercions( Format['ISO8601'] ), output format override question
  • Select or Download Code