/usr/share/perl5/Mango/BSON/Time.pm is in libmango-perl 0.22-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | package Mango::BSON::Time;
use Mojo::Base -base;
use overload '""' => sub { shift->to_string }, fallback => 1;
use Time::HiRes 'time';
sub new { shift->SUPER::new(time => shift // int(time * 1000)) }
sub to_epoch { shift->to_string / 1000 }
sub to_string { shift->{time} }
sub TO_JSON { shift->to_string }
1;
=encoding utf8
=head1 NAME
Mango::BSON::Time - Datetime type
=head1 SYNOPSIS
use Mango::BSON::Time;
my $time = Mango::BSON::Time->new(time * 1000);
say $time->to_epoch;
=head1 DESCRIPTION
L<Mango::BSON::Time> is a container for the BSON datetime type used by
L<Mango::BSON>.
=head1 METHODS
L<Mango::BSON::Time> inherits all methods from L<Mojo::Base> and implements
the following new ones.
=head2 new
my $time = Mango::BSON::Time->new;
my $time = Mango::BSON::Time->new(time * 1000);
Construct a new L<Mango::BSON::Time> object.
=head2 to_epoch
my $epoch = $time->to_epoch;
Convert time to floating seconds since the epoch.
=head2 to_string
my $str = $time->to_string;
my $str = "$time";
Stringify time.
=head1 SEE ALSO
L<Mango>, L<Mojolicious::Guides>, L<http://mojolicio.us>.
=cut
|