Dancer2...re::Time(3)
π Dancer2::Core::Time π
okay bestie, pull up a chair because we're talking about Dancer2::Core::Time β a whole class whose entire job is handling the common helpers for time manipulations β¨. it lives in the User Contributed Perl Documentation corner of the manual world, and yes it's a real one, not a vibe. π«Ά
πΈ VERSION πΈ
version 2.2.1 β that's the one, no cap. π
β¨ SYNOPSIS β¨
look at this absolute icon of a snippet:
my $time = Dancer2::Core::Time->new( expression => "1h" );
$time->seconds; # return 3600
that's it. that's the whole flex. one hour goes in, 3600 comes out, and the # return 3600 comment is literally right there in the source, we love a self-documenting moment. π
π¦ DESCRIPTION π¦
so here's the tea, bestie. for consistency, whenever something needs to work with time, it needs to be expressed in seconds, with a timestamp. that's great for the machine and great for calculations, but lowkey it is not very handy for a human-being β think, like, someone staring at a configuration file at 2am wondering what 86400 means. π
so this class provides everything needed to translate any human-understandable expression into a number of seconds. it's giving translator, it's giving glow-up for your config files, it's giving main character energy. periodt. π
π ATTRIBUTES π
β seconds
Number of seconds represented by the object. defaults to 0. simple, clean, iconic.
β epoch
The current epoch to handle. defaults to seconds + time β so it's doing the little math moment for you. π§
β epoch... wait no, it's gmt_string π
Convert the current value in epoch as a GMT string. yes bestie, GMT string, we love a timezone-honest queen. π
β expression
Required. π₯ this one is a human readable expression representing the number of seconds to provide.
The format supported is a number followed by an expression. it currently understands:
s second seconds sec secs
m minute minutes min mins
h hr hour hours
d day days
w week weeks
M month months
y year years
heads up bestie: Months and years are currently fixed at 30 and 365 days. This may change. so like, don't build your entire life plan on it, okay? π
Anything else is used verbatim as the expression of a number of seconds. no guessing, no converting, just vibes straight through. π
Example:
2 hours, 3 days, 3d, 1 week, 3600, etc...
the etc... is literally in the docs and honestly? iconic. it's giving "you get the idea, bestie." π
π«Ά AUTHOR π«Ά
Dancer Core Developers β the group chat we all owe a thank-you note to. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2026 by Alexis Sukrieh.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, genuinely. free software is the moment. πΈ
and that's the page, bestie!! this beauty is perl v5.42.3 and it was dated 2026-09-20 β go forth and convert your human time expressions into seconds, you absolute legend. π β¨ππ¦
π¦ where this page comes from
- fedora 44: perl-Dancer2 2.2.1-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms