Nishibayashi Takuji > DateTimeX-Factory-0.03 > DateTimeX::Factory::Declare

Download:
DateTimeX-Factory-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

DateTimeX::Factory::Declare - DateTimeX::Factory function interface.

VERSION ^

This document describes DateTimeX::Factory::Declare version 0.03.

SYNOPSIS ^

    use DateTimeX::Factory::Declare;

    DateTimeX::Factory->set_time_zone(DateTime::TimeZone->new(name => 'Asia/Tokyo'));
    my $dt = dt_new(year => 2011, month => 2, day => 1); #call DateTimeX::Factory->create
    my $now = dt_now;
    my $today = dt_today;
    my $yesterday = dt_yesterday;
    my $someday = dt_strptime('2011-02-01', '%F');

    #Set timezone
    use DateTimeX::Factory::Declare  (time_zone => 'Asia/Tokyo');

    #Use DateTimeX::Factory instance
    use DateTimeX::Factory;
    use DateTimeX::Factory::Declare  (factory => DateTimeX::Factory->new(time_zone => 'UTC'));

DESCRIPTION ^

DateTimeX::Factory function interface.

Can call DateTimeX::Factory method as dt_{method_name}(%params);

FUNCTIONS ^

dt_new(%params), dt_now(%params), dt_today(%params), dt_from_epoch(%params), dt_last_day_of_month(%params), dt_from_day_of_year(%params)

See document of DateTime and DateTimeX::Factory.

dt_strptime($string, $pattern), dt_from_mysql_datetime($string), dt_from_mysql_date($string), dt_from_ymd($string, $delimiter)

See document of DateTimeX::Factory.

SEE ALSO ^

DateTimeX::Factory

AUTHOR ^

Nishibayashi Takuji <takuji@senchan.jp>

syntax highlighting: