Data-Quantity
view release on metacpan or search on metacpan
Quantity/Time/Date.pm view on Meta::CPAN
### Data::Quantity::Time::Date - A calendar day on earth during the modern epoch
### Change History
# 2001-02-21 Added Mon dd, yy format.
# 2001-02-07 Added yymmdd format.
# 2000-03-29 Added Month dd, yyyy format.
# 1999-12-05 Added mm/dd/yy format.
# 1999-11-22 Added mm/dd/yyyy format.
# 1999-08-13
# 1999-03-28 Added default format and error handling for readable method
# 1998-12-02 Created. -Simon
package Data::Quantity::Time::Date;
require 5;
use strict;
use Carp;
use Time::Local;
use Time::JulianDay;
use Time::ParseDate;
use vars qw( $VERSION );
$VERSION = 0.001;
use Data::Quantity::Number::Integer '-isasubclass';
use Data::Quantity::Time::Timestamp;
use Data::Quantity::Time::Year;
use Data::Quantity::Time::MonthOfYear;
use Data::Quantity::Time::DayOfMonth;
use Data::Quantity::Time::DayOfWeek;
use Data::Quantity::Time::YearAndMonth;
# undef = Data::Quantity::Time::Date->scale();
sub scale {
return 'Date';
}
sub type {
return 'temporal', 'absolute';
}
# $date = Data::Quantity::Time::Date->current();
sub current {
my $class = shift;
my $date = $class->new_instance;
$date->set_udt( time() );
return $date;
}
# $quantity->init( $n_val );
sub init {
my $num_q = shift;
my $n_val = shift;
my $numerals = $num_q->numeric_value( $n_val );
if ( defined $numerals ) {
$num_q->value( $numerals );
} else {
$num_q->set_from_string( $n_val );
( run in 1.585 second using v1.01-cache-2.11-cpan-39bf76dae61 )