The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mango::BSON::Time - Datetime type

SYNOPSIS

  use Mango::BSON::Time;

  my $time = Mango::BSON::Time->new(time * 1000);
  say $time->to_epoch;

DESCRIPTION

Mango::BSON::Time is a container for the BSON datetime type used by Mango::BSON.

METHODS

Mango::BSON::Time inherits all methods from Mojo::Base and implements the following new ones.

new

  my $time = Mango::BSON::Time->new;
  my $time = Mango::BSON::Time->new(time * 1000);

Construct a new scalar-based Mango::BSON::Time object.

to_epoch

  my $epoch = $time->to_epoch;

Convert time to epoch seconds.

SEE ALSO

Mango, Mojolicious::Guides, http://mojolicio.us.