Apache2-API
view release on metacpan or search on metacpan
lib/Apache2/API/DateTime.pm view on Meta::CPAN
Given a datetime string, this returns, in list context, a list of day, month, year, hour, minute, second and time zone or an iso 8601 datetime string in scalar context.
This is used by the method L</str2datetime>
=head2 parse_datetime
Provided with a date string, and this will parse it and return a L<DateTime> object, or sets an L<error|Module::Generic/error> and return C<undef> or an empty list depending on the context.
=head2 str2datetime
Given a string that looks like a date, this will parse it and return a L<DateTime> object.
=head2 str2time
Given a string that looks like a date, this returns its representation as a unix timestamp in second since epoch.
In the background, it calls L</str2datetime> for parsing.
=head2 time2datetime
Given a unix timestamp in seconds since epoch, this returns a L<DateTime> object.
=head2 time2str
Given a unix timestamp in seconds since epoch, this returns a string representation of the timestamp suitable for HTTP headers and cookies. The format is like C<Sat, 14 Dec 2019 22:12:30 GMT>
( run in 0.467 second using v1.01-cache-2.11-cpan-64827b87656 )