This is the pattern to use for parsing. This is required.
The default time zone to use for objects returned from parsing.
Some time zone abbreviations are ambiguous (e.g. PST, EST, EDT). By default, the parser will die when it parses an ambiguous abbreviation. You may specify a zone_map parameter as a hashref to map zone abbreviations however you like:
Note that you can also override non-ambiguous mappings if you want to as well.
The locale to use for objects returned from parsing.
This can be one of undef (the string, not an undef), croak, or a subroutine reference.
If given a string that doesnt match the pattern, the formatter will croak or
return undef, depending on the setting of on_error in the constructor.
Given a DateTime object, this methods returns a string formatted in the
objects format. This method is synonymous with DateTimes strftime method.
This method returns the locale passed to the objects constructor.
This method returns the pattern passed to the objects constructor.
This method returns the time zone passed to the objects constructor.
If the on_error behavior of the object is undef, you can retrieve error
messages with this method so you can work out why things went wrong.
These subs are available as optional exports.
strptime( CW$strptime_pattern, CW$string )Given a pattern and a string this function will return a new DateTime object.
strftime( CW$strftime_pattern, CW$datetime )Given a pattern and a DateTime object this function will return a formatted string.
The following tokens are allowed in the pattern string for strptime (parse_datetime):
The % character.
o %a or %A
The weekday name according to the current locale, in abbreviated form or the full name.
o %b or %B or %h
The month name according to the current locale, in abbreviated form or the full name.
The century number (0-99).
o %d or %e
The day of month (01-31). This will parse single digit numbers as well.
Equivalent to %m/%d/%y. (This is the American style date, very confusing to non-Americans, especially since %d/%m/%y is widely used in Europe. The ISO 8601 standard pattern is %F.)
Equivalent to %Y-%m-%d. (This is the ISO style date)
The year corresponding to the ISO week number, but without the century (0-99).
The 4-digit year corresponding to the ISO week number.
The hour (00-23). This will parse single digit numbers as well.
The hour on a 12-hour clock (1-12).
The day number in the year (1-366).
The month number (01-12). This will parse single digit numbers as well.
The minute (00-59). This will parse single digit numbers as well.
Nanoseconds. For other sub-second values use %[number]N.
o %p o %r
Equivalent to %I:%M:%S %p.
Equivalent to %H:%M.
Number of seconds since the Epoch.
The second (0-60; 60 may occur for leap seconds. See DateTime::LeapSecond).
Equivalent to %H:%M:%S.
o %U o %u
The weekday number (1-7) with Monday = 1. This is the DateTime standard.
The weekday number (0-6) with Sunday = 0.
o %W o %y
The year within century (0-99). When a century is not otherwise specified (with a value for %C), values in the range 69-99 refer to years in the twentieth century (1969-1999); values in the range 00-68 refer to years in the twenty-first century (2000-2068).
A 4-digit year, including century (for example, 1991).
An RFC-822/ISO 8601 standard time zone specification. (For example +1100) [See note below]
The timezone name. (For example EST which is ambiguous) [See note below]
This extended token allows the use of Olson Time Zone names to appear in parsed strings. <B>NOTEB>: This pattern cannot be passed to DateTimes strftime() method, but can be passed to format_datetime().
This module was created by Rick Measham.
email@example.com mailing list.
Please report any bugs or feature requests to firstname.lastname@example.org, or through the web interface at <http://rt.cpan.org>. I will be notified, and then youll automatically be notified of progress on your bug as I make changes.
Bugs may be submitted through the RT bug tracker <http://rt.cpan.org/Public/Dist/Display.html?Name=DateTime-Format-Strptime> (or email@example.com <mailto:firstname.lastname@example.org>).
There is a mailing list available for users of this distribution, <mailto:email@example.com>.
I am also usually active on IRC as drolsky on irc://irc.perl.org.
If youd like to thank me for the work Ive done on this module, please consider making a donation to me via PayPal. I spend a lot of free time creating free software, and would appreciate any support youd care to offer.
Please note that <B>I am not suggesting that you must do thisB> in order for me to continue working on this particular software. I will continue to do so, inasmuch as I have in the past, for as long as it interests me.
Similarly, a donation made in this way will probably not make me work on this software much more, unless I get so many donations that I can consider working on free software full time (lets all have a chuckle at that together).
o Dave Rolsky <firstname.lastname@example.org> o Rick Measham <email@example.com>
o D. Ilmari Mannsaaker <firstname.lastname@example.org> o key-amb <email@example.com>
This software is Copyright (c) 2015 - 2016 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
|perl v5.20.3||DATETIME::FORMAT::STRPTIME (3)||2016-03-31|