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

See "new" in Time::Moment.

now

See "now" in Time::Moment.

now_utc

See "now_utc" in Time::Moment.

from_epoch

See "from_epoch" in Time::Moment.

from_object

See "from_object" in Time::Moment.

from_string

See "from_string" in Time::Moment.

from_rd

See "from_rd" in Time::Moment.

from_jd

See "from_jd" in Time::Moment.

from_mjd

See "from_mjd" in Time::Moment.

ACCESSORS

These accessors will work as LVALUEs, meaning you can assign to them to change the time being represented.

year

See "year" in Time::Moment, "with_year" in Time::Moment, "plus_years" in Time::Moment, "minus_years" in Time::Moment.

quarter

See "quarter" in Time::Moment, "with_quarter" 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

See "epoch" in Time::Moment, "from_epoch" in Time::Moment.

rd

See "rd" in Time::Moment, "from_rd" in Time::Moment.

jd

See "jd" in Time::Moment, "from_jd" in Time::Moment.

mjd

See "mjd" in Time::Moment, "from_mjd" in Time::Moment.

tm

This returns the current internal Time::Moment object. This becomes a new object every time something is changed.

SEE ALSO

Time::Moment

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