NAME
Astro::App::Satpass2::ParseTime::Date::Manip::v6 - Astro::App::Satpass2 wrapper for Date::Manip v6 or greater
SYNOPSIS
No user-serviceable parts inside.
DETAILS
This class wraps the Date::Manip::Date object from Date::Manip version 6.0 or higher, and uses it to parse dates. It ignores the perltime
mechanism.
Caveat: the Date::Manip configuration mechanism (used to set the time zone) reports errors using the warn
built-in, rather than by returning a bad status or throwing an exception. Yes, I could use the $SIG{__WARN__}
hook to trap this, but I would rather hope that Mr. Beck will provide a more friendly mechanism.
METHODS
This class supports the following public methods over and above those documented in its superclass Astro::App::Satpass2::ParseTime.
dmd_err
my $error_string = $pt->dmd_err();
This method wraps the Date::Manip::Date object's err() method, and returns whatever that method returns.
dmd_zone
my $zone_name = $pt->dmd_zone();
This method wraps the Date::Manip::TZ object's zone() method, calling it in scalar context to get the default zone name, and returning the result.
Note that unlike the inherited tz()
method, this is an accessor only, and, it is possible that $pt->dmd_zone()
will not return the same thing that $pt->tz()
does. For example,
$pt->tz( 'EST5EDT' );
print '$pt->tz(): ', $pt->tz(), "\n";
print '$pt->dmd_zone(): ', $pt->dmd_zone(), "\n";
prints
$pt->tz(): EST5EDT
$pt->dmd_zone(): America/New_York
This is because $pt->tz()
returns the last setting, whereas $pt->dmd_zone()
returns the name of the time zone in the Olson zoneinfo database, which is typically something like Continent/City
, even though the time zone was set using an alias, abbreviation or offset. See Date::Manip::TZ for the gory details.
Another difference is the if the time zone has never been set, $pt->tz()
will return undef
, whereas $pt->dmd_zone()
will actually return the name of the default zone.
SUPPORT
Support is by the author. Please file bug reports at http://rt.cpan.org, or in electronic mail to the author.
AUTHOR
Thomas R. Wyant, III wyant at cpan dot org
COPYRIGHT AND LICENSE
Copyright (C) 2009-2011 by Thomas R. Wyant, III
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.