DateTime-Format-Japanese
view release on metacpan or search on metacpan
lib/DateTime/Format/Japanese.pm view on Meta::CPAN
);
my $str = $fmt->format_datetime($dt);
my $dt = $fmt->parse_datetime("å¹³æï¼ï¼å¹´ï¼æï¼ï¼æ¥ååï¼æï¼ï¼å");
=head1 DESCRIPTION
This module implements a DateTime::Format module that can read Japanese
date notations and create a DateTime object, and vice versa.
All formatting methods will return a decoded utf-8 string, unless otherwise
specified explicitly via the output_encoding parameter.
All parsing methods expect a decoded utf-8 string, unless otherwise specified
explicitly via the input_encoding parameter
=head1 METHODS
=head2 new()
This constructor will create a DateTime::Format::Japanese object.
You may optionally pass any of the following parameters:
number_format - how to format numbers (default: FORMAT_KANJI)
lib/DateTime/Format/Japanese.pm view on Meta::CPAN
I<formatting>, and not I<parsing>, except for input_encoding. Parsing
is done in a way such that it accepts any of the known formats that
this module can produce.
=head2 $fmt-E<gt>parse_datetime($string)
This function will parse a Japanese date/time string and convert it to a
DateTime object. If the parsing is unsuccessful, it will croak.
Note that if you didn't provide a input_encoding parameter, the given
string is assumed to be decoded utf-8.
This function should be able to parse almost all of the common Japanese
date notations, whether they are written using ascii numerals, double byte
numerals, and kanji numerals. The date components (year, month, day or
era name, era year, month, day) must be present in the string. The time
components are optional.
This method can be called as a class function as well.
my $dt = DateTime::Format::Japanese->parse_datetime($string);
( run in 3.191 seconds using v1.01-cache-2.11-cpan-26ccb49234f )