NAME
Time::C - Convenient time manipulation.
VERSION
version 0.001
SYNOPSIS
use Time::C;
my $t = Time::C->from_string('2016-09-23T04:28:30Z');
# 2016-01-01T04:28:30Z
$t->month = $t->day = 1;
# 2016-01-01T00:00:00Z
$t->hour = $t->minute = $t->second = 0;
# 2016-02-04T00:00:00Z
$t->month += 1; $t->day += 3;
# 2016-03-03T00:00:00Z
$t->day += 28;
DESCRIPTION
Makes manipulating time structures more convenient. Internally uses Time::Moment.
CONSTRUCTORS
All the constructors simply pass along their arguments to the constructor with the same name from Time::Moment.
- new
- now
- now_utc
- from_epoch
- from_object
- from_string
- from_rd
- from_jd
- from_mjd
ACCESSORS
These accessors will work as LVALUE
s, meaning you can assign to them to change the time being represented. The actual underlying Time::Moment object won't be replaced until the next time you try to access a value.
- year
-
See "year" in Time::Moment, "with_year" in Time::Moment, "plus_years" in Time::Moment, "minus_years" in Time::Moment.
- month
-
See "month" in Time::Moment, "with_month" in Time::Moment, "plus_months" in Time::Moment, "minus_months" in Time::Moment.
- week
-
See "week" in Time::Moment, "with_week" in Time::Moment, "plus_weeks" in Time::Moment, "minus_weeks" in Time::Moment.
- day
- day_of_month
-
See "day_of_month" in Time::Moment, "with_day_of_month" in Time::Moment, "plus_days" in Time::Moment, "minus_days" in Time::Moment.
- day_of_year
-
See "day_of_year" in Time::Moment, "with_day_of_year" in Time::Moment, "plus_days" in Time::Moment, "minus_days" in Time::Moment.
- day_of_quarter
-
See "day_of_quarter" in Time::Moment, "with_day_of_quarter" in Time::Moment, "plus_days" in Time::Moment, "minus_days" in Time::Moment.
- day_of_week
-
See "day_of_week" in Time::Moment, "with_day_of_week" in Time::Moment, "plus_days" in Time::Moment, "minus_days" in Time::Moment.
- hour
-
See "hour" in Time::Moment, "with_hour" in Time::Moment, "plus_hours" in Time::Moment, "minus_hours" in Time::Moment.
- minute
-
See "minute" in Time::Moment, "with_minute" in Time::Moment, "plus_minutes" in Time::Moment, "minus_minutes" in Time::Moment.
- second
-
See "second" in Time::Moment, "with_second" in Time::Moment, "plus_seconds" in Time::Moment, "minus_seconds" in Time::Moment.
- millisecond
-
See "millisecond" in Time::Moment, "with_millisecond" in Time::Moment, "plus_milliseconds" in Time::Moment, "minus_milliseconds" in Time::Moment.
- microsecond
-
See "microsecond" in Time::Moment, "with_microsecond" in Time::Moment, "plus_microseconds" in Time::Moment, "minus_microseconds" in Time::Moment.
- nanosecond
-
See "nanosecond" in Time::Moment, "with_nanosecond" in Time::Moment, "plus_nanoseconds" in Time::Moment, "minus_nanoseconds" in Time::Moment.
- offset
-
See "offset" in Time::Moment, "with_offset" in Time::Moment.
- string
-
See "stringification" in Time::Moment, "from_string" in Time::Moment.
- epoch
- rd
- jd
- mjd
- tm
-
This returns the current internal Time::Moment object. This becomes a new object every time something is changed.
SEE ALSO
AUTHOR
Andreas Guldstrand <andreas.guldstrand@gmail.com>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2016 by Andreas Guldstrand.
This is free software, licensed under:
The MIT (X11) License