Time-Normalize
view release on metacpan or search on metacpan
lib/Time/Normalize.pm view on Meta::CPAN
=for gpg
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
=head1 NAME
Time::Normalize - Convert time and date values into standardized components.
=head1 VERSION
This is version 0.09 of Time::Normalize, April 23, 2014.
=cut
use strict;
package Time::Normalize;
$Time::Normalize::VERSION = '0.09';
use Carp;
use Exporter;
use vars qw/@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS/;
@ISA = qw/Exporter/;
@EXPORT = qw/normalize_hms normalize_time normalize_ymd normalize_gmtime
normalize_month normalize_year normalize_ym
normalize_ymd3 normalize_ym3
normalize_ymdhms normalize_rct
/;
@EXPORT_OK = (@EXPORT, qw(mon_name mon_abbr day_name day_abbr days_in is_leap));
%EXPORT_TAGS = (all => \@EXPORT_OK);
# Is POSIX available?
eval {require POSIX };
my $have_posix = $@? 0 : 1;
# Delay loading Carp until needed
sub _croak
{
require Carp;
goto &Carp::croak;
}
# Most error messages in this module look very similar.
# This standardizes them:
sub _bad
{
my ($what, $value) = @_;
$value = '(undefined)' if !defined $value;
_croak qq{Time::Normalize: Invalid $what: "$value"};
}
# Current locale.
my $locale;
# Month names; Month names abbrs, Weekday names, Weekday name abbrs.
# *All Mixed-Case!*
our (@Mon_Name, @Mon_Abbr, @Day_Name, @Day_Abbr);
# Lookup: string-month => numeric-month (also string-day => numeric-day)
our %number_of;
# We need english-only names to parse R::C::t's 'mail' format.
my $mail_month_number;
our $use_mail_months;
lib/Time/Normalize.pm view on Meta::CPAN
If L<POSIX> and L<I18N::Langinfo> is available, this module will use
them; otherwise, it will use hardcoded English values for month and
weekday names.
L<Test::More> is required for the test suite.
=head1 SEE ALSO
See L<Regexp::Common::time> for a L<Regexp::Common> plugin that
matches nearly any date format imaginable.
=head1 BUGS
=over
=item *
Uses Gregorian rules for computing whether a year is a leap year, no
matter how long ago the year was.
=back
=head1 NOT A BUG
=over
=item *
By convention, noon is 12:00 pm; midnight is 12:00 am.
=back
=head1 AUTHOR / COPYRIGHT
Copyright © 2005â2014 by Eric J. Roode, ROODE I<-at-> cpan I<-dot-> org
All rights reserved.
To avoid my spam filter, please include "Perl", "module", or this
module's name in the message's subject line, and/or GPG-sign your
message.
This module is copyrighted only to ensure proper attribution of
authorship and to ensure that it remains available to all. This
module is free, open-source software. This module may be freely used
for any purpose, commercial, public, or private, provided that proper
credit is given, and that no more-restrictive license is applied to
derivative (not dependent) works.
Substantial efforts have been made to ensure that this software meets
high quality standards; however, no guarantee can be made that there
are no undiscovered bugs, and no warranty is made as to suitability to
any given use, including merchantability. Should this module cause
your house to burn down, your dog to collapse, your heart-lung machine
to fail, your spouse to desert you, or George Bush to be re-elected, I
can offer only my sincere sympathy and apologies, and promise to
endeavor to improve the software.
=cut
=begin gpg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (MingW32)
iEYEARECAAYFAlNX4w8ACgkQwoSYc5qQVqoLMQCffdGYkRCvZPFLpLZ3quHifjji
U5MAnil5mEb46mgKbfZ6lsNLNLT3Qh8O
=RW4m
-----END PGP SIGNATURE-----
=end gpg
( run in 0.461 second using v1.01-cache-2.11-cpan-df04353d9ac )