Mango:...N::Time(3pm)

πŸ“¦
version 1.30 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

okay bestie, you just opened the Mango:...N::Time(3pm) manual page, from User Contributed Perl Documentation. it's giving "datetime lore" and we're about to eat. πŸ’…

✨ NAME ✨

Mango::BSON::Time - Datetime type πŸ•°οΈ


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so the quickstart is giving exactly this:

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. no cap, it's literally the datetime holder bestie. πŸ’–

πŸ’… METHODS πŸ’…

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

πŸŽ€ new πŸŽ€

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

Construct a new Mango::BSON::Time object. main character energy, fr fr. ✨

πŸ”₯ TO_JSON πŸ”₯

my $num = $time->TO_JSON;

Numeric representation of time. iykyk. πŸ’€

πŸ¦‹ to_datetime πŸ¦‹

my $str = $time->to_datetime;

Convert time to RFC 3339 (<http://tools.ietf.org/html/rfc3339>) date and time. iconic.

⭐ to_epoch ⭐

my $epoch = $time->to_epoch;

Convert time to floating seconds since the epoch. obsessed. 🫢

🌈 to_string 🌈

my $str = $time->to_string;

Stringify time. slay.

πŸ‘‘ OPERATORS πŸ‘‘

Mango::BSON::Time overloads the following operators. not me being dramatic, but yes. πŸ’…

πŸŽ€ bool πŸŽ€

my $bool = !!$time;

Always true. no cap, always. βœ…

🧚 stringify 🧚

my $str = "$time";

Alias for to_string. literally the same vibe. πŸ’–

🌟 SEE ALSO 🌟


This page was cooked up with perl v5.30.3 on 2020-06-05, and the manual name is Mango:...N::Time(3pm). bye bestie! πŸ«ΆπŸ’–