Datacenter build and management service
Conch::Time - format timestamps as RFC 3337 UTC timestamps
use Conch::Time;
my $postgres_timestamp = '2018-01-26 12:24:18.893874-07';
my $time = Conch::Time->new($postgres_timestamp);
$time eq $time; # 1
Overloads the constructor to use ->from_string
when a single argument is passed.
Conch::Time->new($pg_timestamptz);
... and any other constructor modes supported by Time::Moment
my $t = Conch::Time->now;
Return an object based on the current time, using the UTC timezone.
Time are high resolution and will generate unique timestamps to the nanosecond.
Conch::Time->from_epoch(time);
Conch::Time->from_epoch(Time::HiRes::gettimeofday);
Conch::Time->from_epoch(1234567890, 123);
See also “from_epoch” in Time::Moment.
Return an RFC3339 compatible string as UTC. Sub-second precision will use 3, 6 or 9 digits as necessary.
Return an RFC3339 compatible string.
Render the timestamp as a RFC 3339 timestamp string. Used to overload string coercion.
Renderer for Mojo, as a RFC 3339 timestamp string
Render a string in PostgreSQL’s timestamptz style
Render the timestamp as an ISO8601 extended format, in UTC
Copyright Joyent, Inc.
This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.