DateTimeX::Easy

Parse a date/time string using the best method available
Download

DateTimeX::Easy Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Robert Krimen
  • Publisher web site:
  • http://search.cpan.org/~rkrimen/

DateTimeX::Easy Tags


DateTimeX::Easy Description

Parse a date/time string using the best method available DateTimeX::Easy is a Perl module that makes DateTime object creation quick and easy. It uses a variety of DateTime::Format packages to do the bulk of the parsing, with some custom tweaks to smooth out the rough edges (mainly concerning timezone detection and selection).SYNOPSIS # Make DateTimeX object for "now": my $dt = DateTimeX::Easy->new("today"); # Same thing: my $dt = DateTimeX::Easy->new("now"); # Uses ::F::Natural's coolness (similar in capability to Date::Manip) my $dt = DateTimeX::Easy->new("last monday"); # ... but in 1969: my $dt = DateTimeX::Easy->new("last monday", year => 1969); # ... at the 100th nanosecond: my $dt = DateTimeX::Easy->new("last monday", year => 1969, nanosecond => 100); # ... in US/Eastern: (This will NOT do a timezone conversion) my $dt = DateTimeX::Easy->new("last monday", year => 1969, nanosecond => 100, timezone => "US/Eastern"); # This WILL do a proper timezone conversion: my $dt = DateTimeX::Easy->new("last monday", year => 1969, nanosecond => 100, timezone => "US/Pacific"); $dt->set_time_zone("US/Eastern"); # Custom DateTimeX ability: my $dt = DateTimeX::Easy->new("last second of last month"); $dt = DateTimeX::Easy->new("last second of first month of last year"); $dt = DateTimeX::Easy->new("last second of first month of 2000"); Requirements: · Perl


DateTimeX::Easy Related Software