NAME
Pinwheel::Model::DateBase - base class for date/time data types
SYNOPSIS
# $dt = Pinwheel::Model::Date ....
# or
# $dt = Pinwheel::Model::Time ....
$dt->year; # e.g. 2008
$dt->month; # month, 1..12
$dt->day; # day of the month, 1..31
$dt->mm; # month, "01".."12"
$dt->dd; # day of the month, "01".."31"
$dt->wday; # day of the week, 0(Sun)..6(Sat)
$dt->yday; # day of the year, 0(1 Jan)..365(31 Dec in a leap year)
$dt->bbc_year; # ?
$dt->bbc_week; # ?
$dt->iso_year; # ?
$dt->iso_week; # ?
$dt->iso_weekday; # day of the week, 1(Mon)..7(Sun)
$dt->days_in_month; # number of days in this month
$dt->month_name; # "January".."December"
$dt->short_month_name; # "Jan".."Dec"
$dt->day_name; # "Sunday".."Saturday"
$dt->short_day_name; # "Sun".."Sat"
$dt->day_suffix; # one of: "st" "nd" "rd" "th"
$dt->day_ordinal; # e.g. "1st", "2nd", ... "31st"
$dt->strftime($format); # see "man strftime"
# $dt->replace returns a new object (of the same type as $dt)
# by replacing parts of $dt according to %values. Allowed keys in %values
# are: sec min hour day month year.
# TODO: document validation, range checking, etc.
$new_dt = $dt->replace(%values);
$dt->last_of_month; # $dt->replace(day => 31)
$dt->first_of_month; # $dt->replace(day => 1)
# $dt->offset returns a new object (of the same type as $dt)
# by adjusting $dt according to %deltas. Allowed keys in %deltas are:
# days, months, years.
# TODO: document how 'months' works, and what about leap days in 'years'
$new_dt = $dt->offset(%deltas);
$dt->next_day; # $dt->offset(days => +1)
$dt->previous_day; # $dt->offset(days => -1)
$dt->next_week; # $dt->offset(days => +7)
$dt->previous_week; # $dt->offset(days => -7)
$dt->next_month; # $dt->offset(months => +1)
$dt->previous_month; # $dt->offset(months => -1)
SEE ALSO
Pinwheel::Model::Date, Pinwheel::Model::Time
AUTHOR
A&M Network Publishing <DLAMNetPub@bbc.co.uk>