Ubuntu Manpages

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

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

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

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

Construct a new Mango::BSON::Time object.

  my $epoch = $time->to_epoch;

Convert time to floating seconds since the epoch.

  my $str = $time->to_string;
  my $str = "$time";

Stringify time.

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