in reply to DateTime and ISO8601
This is not precisely what you are looking for, but I'll offer it as an alternative.
I found the same problem when I was adding support for ISO8601 dates to Date::Manip, and I wanted to find out which fields had been set.
Date::Manip (which will parse all of the ISO8601 dates) has a method (complete) which will tell you what fields were explicitly added, and which are implied. So you end up with:
prints:use Date::Manip::Date; my $obj = new Date::Manip::Date; $obj->parse("2000-06-01-00:00"); print $obj->value(),"\n"; print $obj->complete('h'),"\n"; print $obj->complete('m'),"\n"; print $obj->complete('s'),"\n";
So, if you can't get DateTime to do it, you may want to look at Date::Manip.2000060100000 1 1 0
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: DateTime and ISO8601
by philkime (Beadle) on May 19, 2016 at 20:47 UTC |
In Section
Seekers of Perl Wisdom