Name

SPVM::Time::Info - Time information

Usage

use Time::Info;

# Time information
my $time_info = Time::Info->new;

# Set and get second
my $sec = $time_info->tm_sec;
$time_info->set_tm_sec(12);

# Set and get minutes
my $min = $time_info->tm_min;
$time_info->set_tm_min(34);

# Set and get hour
my $hour = $time_info->tm_hour;
$time_info->set_tm_hour(12);

# Set and get day of month
my $mday = $time_info->tm_mday;
$time_info->set_tm_mday(4);

# Set and get month
my $mon = $time_info->tm_mon;
$time_info->set_tm_mon(3);

# Set and get year
my $year = $time_info->tm_year;
$time_info->set_tm_year(1);

# Set and get week day
my $wday = $time_info->tm_wday;
$time_info->set_tm_wday(12);

# Set and get day of year
my $yday = $time_info->tm_yday;
$time_info->set_tm_yday(234);

# Set and get the specified time occurs during Daylight Saving Time
my $isdst = $time_info->tm_isdst;
$time_info->set_tm_isdst(1);

Description

Time::Info is the time information that date structure is struct tm of C language.

Class Methods

new

static method new : Time::Info ()

Create a new Time::Info object.

my $time_info = Time::Info->new;

Instance Methods

sec

method sec : int ()

Get second. This is same as getting tm_sec of struct tm.

my $sec = $time_info->tm_sec;

set_tm_sec

method set_tm_sec : void ($sec : int)

Set second. This is same as setting tm_sec of struct tm.

$time_info->set_tm_sec(12);

min

method min : int ()

Get minutes. This is same as getting tm_min of struct tm.

my $min = $time_info->tm_min;

set_tm_min

method set_tm_min : void ($min : int)

Set minutes. This is same as setting tm_min of struct tm.

$time_info->set_tm_min(34);

hour

method hour : int ()

Get hour. This is same as getting tm_hour of struct tm.

my $hour = $time_info->tm_hour;

set_tm_hour

method set_tm_hour : void ($hour : int)

Set hour. This is same as setting tm_hour of struct tm.

$time_info->set_tm_hour(12);

mday

method mday : int ()

Get day of month. This is same as getting tm_mday of struct tm.

my $mday = $time_info->tm_mday;

set_tm_mday

method set_tm_mday : void ($mday : int)

Set day of month. This is same as setting tm_mday of struct tm.

$time_info->set_tm_mday(4);

mon

method mon : int ()

Get month. This is same as getting tm_mon of struct tm.

my $mon = $time_info->tm_mon;

set_tm_mon

method set_tm_mon : void ($mon : int)

Set month. This is same as setting tm_mon of struct tm.

$time_info->set_tm_mon(3);

year

method year : int ()

Get year. This is same as getting tm_year of struct tm.

my $year = $time_info->tm_year;

set_tm_year

method set_tm_year : void ($year : int)

Set year. This is same as setting tm_year of struct tm.

$time_info->set_tm_year(1);

wday

method wday : int ()

Get weekday. This is same as getting tm_wday of struct tm.

my $wday = $time_info->tm_wday;

set_tm_wday

method set_tm_wday : void ($wday : int)

Set weekday. This is same as setting tm_wday of struct tm.

$time_info->set_tm_wday(12);

yday

method yday : int ()

Get day of year. This is same as getting tm_yday of struct tm.

my $yday = $time_info->tm_yday;

set_tm_yday

method set_tm_wday : void ($wday : int)

Set day of year. This is same as setting tm_yday of struct tm.

$time_info->set_tm_yday(234);

isdst

method isdst : int ()

Get the flag whether the time is daylight saving time. This is same as getting tm_yday of struct tm.

my $isdst = $time_info->tm_isdst;

set_tm_isdst

method set_tm_isdst : void ($isdst : int)

Set the flag whether the time is daylight saving time. This is same as getting tm_isdst of struct tm.

$time_info->set_tm_isdst(1);