Name

SPVM::Sys::Time::Tm - struct tm in C language

Usage

use Sys::Time::Tm;

my $tm = Sys::Time::Tm->new;

my $sec = $tm->tm_sec;
$tm->set_tm_sec(12);

my $min = $tm->tm_min;
$tm->set_tm_min(34);

my $hour = $tm->tm_hour;
$tm->set_tm_hour(12);

my $mday = $tm->tm_mday;
$tm->set_tm_mday(4);

my $mon = $tm->tm_mon;
$tm->set_tm_mon(3);

my $year = $tm->tm_year;
$tm->set_tm_year(1);

my $wday = $tm->tm_wday;
$tm->set_tm_wday(12);

my $yday = $tm->tm_yday;
$tm->set_tm_yday(234);

my $isdst = $tm->tm_isdst;
$tm->set_tm_isdst(1);

Description

The Sys::Time::Tm class represents struct tm of the C language.

See ctime(3) - Linux man page about struct tm in Linux.

Class Methods

new

static method new : Sys::Time::Tm ();

Creates a new Sys::Time::Tm object.

my $tm = Sys::Time::Tm->new;

Instance Methods

tm_sec

method tm_sec : int ();

Gets tm_sec.

my $tm_sec = $tm->tm_sec;

set_tm_sec

method set_tm_sec : void ($tm_sec : int);

Sets tm_sec.

$tm->set_tm_sec(12);

tm_min

method tm_min : int ();

Gets tm_min.

my $tm_min = $tm->tm_min;

set_tm_min

method set_tm_min : void ($tm_min : int);

Sets tm_min.

$tm->set_tm_min(34);

tm_hour

method tm_hour : int ();

Gets tm_hour.

my $tm_hour = $tm->tm_hour;

set_tm_hour

method set_tm_hour : void ($tm_hour : int);

Sets tm_hour.

$tm->set_tm_hour(12);

tm_mday

method tm_mday : int ();

Gets tm_mday.

my $tm_mday = $tm->tm_mday;

set_tm_mday

method set_tm_mday : void ($tm_mday : int);

Sets tm_mday.

$tm->set_tm_mday(4);

tm_mon

method tm_mon : int ();

Gets tm_mon.

my $tm_mon = $tm->tm_mon;

set_tm_mon

method set_tm_mon : void ($tm_mon : int);

Sets tm_mon.

$tm->set_tm_mon(3);

tm_year

method tm_year : int ();

Gets tm_year.

my $tm_year = $tm->tm_year;

set_tm_year

method set_tm_year : void ($tm_year : int);

Sets tm_year.

$tm->set_tm_year(1);

tm_wday

method tm_wday : int ();

Gets tm_wday.

my $tm_wday = $tm->tm_wday;

set_tm_wday

method set_tm_wday : void ($tm_wday : int);

Sets tm_wday.

$tm->set_tm_wday(12);

tm_yday

method tm_yday : int ();

Gets tm_yday.

my $yday = $tm->tm_yday;

set_tm_yday

method set_tm_yday : void ($tm_yday : int);

Sets tm_yday.

$tm->set_tm_yday(234);

tm_isdst

method tm_isdst : int ();

Gets tm_isdst.

my $isdst = $tm->tm_isdst;

set_tm_isdst

method set_tm_isdst : void ($tm_isdst : int);

Sets tm_isdst.

$tm->set_tm_isdst(1);

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License