SPVM::Time::Info - Time information
use Time::Info; # Time information my $time_info = Time::Info->new; # Set and get second my $sec = $time_info->sec; $time_info->set_sec(12); # Set and get minutes my $min = $time_info->min; $time_info->set_min(34); # Set and get hour my $hour = $time_info->hour; $time_info->set_hour(12); # Set and get day of month my $mday = $time_info->mday; $time_info->set_mday(4); # Set and get month my $mon = $time_info->mon; $time_info->set_mon(3); # Set and get year my $year = $time_info->year; $time_info->set_year(1); # Set and get week day my $wday = $time_info->wday; $time_info->set_wday(12); # Set and get day of year my $yday = $time_info->yday; $time_info->set_yday(234); # Set and get the specified time occurs during Daylight Saving Time my $isdst = $time_info->isdst; $time_info->set_isdst(1);
Time::Info is the time information that date structure is struct tm of C language.
Time::Info
struct tm
C language
static method new : Time::Info ()
Create a new Time::Info object.
my $time_info = Time::Info->new;
method sec : int ()
Get second. This is same as getting tm_sec of struct tm.
tm_sec
my $sec = $time_info->sec;
method set_sec : void ($sec : int)
Set second. This is same as setting tm_sec of struct tm.
$time_info->set_sec(12);
method min : int ()
Get minutes. This is same as getting tm_min of struct tm.
tm_min
my $min = $time_info->min;
method set_min : void ($min : int)
Set minutes. This is same as setting tm_min of struct tm.
$time_info->set_min(34);
method hour : int ()
Get hour. This is same as getting tm_hour of struct tm.
tm_hour
my $hour = $time_info->hour;
method set_hour : void ($hour : int)
Set hour. This is same as setting tm_hour of struct tm.
$time_info->set_hour(12);
method mday : int ()
Get day of month. This is same as getting tm_mday of struct tm.
tm_mday
my $mday = $time_info->mday;
method set_mday : void ($mday : int)
Set day of month. This is same as setting tm_mday of struct tm.
$time_info->set_mday(4);
method mon : int ()
Get month. This is same as getting tm_mon of struct tm.
tm_mon
my $mon = $time_info->mon;
method set_mon : void ($mon : int)
Set month. This is same as setting tm_mon of struct tm.
$time_info->set_mon(3);
method year : int ()
Get year. This is same as getting tm_year of struct tm.
tm_year
my $year = $time_info->year;
method set_year : void ($year : int)
Set year. This is same as setting tm_year of struct tm.
$time_info->set_year(1);
method wday : int ()
Get weekday. This is same as getting tm_wday of struct tm.
tm_wday
my $wday = $time_info->wday;
method set_wday : void ($wday : int)
Set weekday. This is same as setting tm_wday of struct tm.
$time_info->set_wday(12);
method yday : int ()
Get day of year. This is same as getting tm_yday of struct tm.
tm_yday
my $yday = $time_info->yday;
Set day of year. This is same as setting tm_yday of struct tm.
$time_info->set_yday(234);
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->isdst;
method set_isdst : void ($isdst : int)
Set the flag whether the time is daylight saving time. This is same as getting tm_isdst of struct tm.
tm_isdst
$time_info->set_isdst(1);
To install SPVM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM
CPAN shell
perl -MCPAN -e shell install SPVM
For more information on module installation, please visit the detailed CPAN module installation guide.