DateTi...:MacOS(3pm)
β¨ DateTi...:MacOS(3pm) β¨
okay bestie so this is a page from the User Contributed Perl Documentation and the manual name is literally DateTi...:MacOS(3pm) (yes the name is truncated like that, iconic of it honestly). buckle up π
πΈ NAME πΈ
DateTime::Format::Epoch::MacOS β the girlies who convert DateTimes to and from Mac OS epoch seconds. periodt π
π¦ SYNOPSIS π¦
use DateTime::Format::Epoch::MacOS;
my $dt = DateTime::Format::Epoch::MacOS->parse_datetime( 1051488000 );
DateTime::Format::Epoch::MacOS->format_datetime($dt);
# 1051488000
my $formatter = DateTime::Format::Epoch::MacOS->new();
my $dt2 = $formatter->parse_datetime( 1051488000 );
$formatter->format_datetime($dt2);
# 1051488000
like, so clean, so demure π«Ά
π DESCRIPTION π
so this module can convert a DateTime object (or literally any object that can be converted to a DateTime object, no gatekeeping) into the number of seconds since the Mac OS epoch. β¨
okay now this is the part where you actually pay attention bestie: the Mac OS epoch is defined in the local time zone. and the way that means these two chunks of code will print the SAME number of seconds even though they're literally representing two datetimes that are 6 hours apart?? yeah. that's the whole vibe. no cap. π
$dt = DateTime->new( year => 2003, month => 5, day => 2,
time_zone => 'Europe/Amsterdam' );
print $formatter->format_datetime($dt);
$dt = DateTime->new( year => 2003, month => 5, day => 2,
time_zone => 'America/Chicago' );
print $formatter->format_datetime($dt);
and also!!! Mac OS X is a Unix system, and it uses the Unix epoch (1970-01-01T00:00:00). so like, if that's what you want, go use DateTime::Format::Epoch::Unix instead. she's the main character for that job π
π METHODS π
most of the methods are the same as the ones in DateTime::Format::Epoch. the only difference is the constructor. that's it, that's the tea β
new()β the constructor of the formatter/parser object. she takes no parameters. literally none. zero. a minimalist queen. π
π SUPPORT π
support for this module is provided via the datetime@perl.org email list. go check http://lists.perl.org/ for more details π¦
π AUTHOR π
Eugene van der Pijll <pijll@gmx.net> β shoutout to the icon π
β COPYRIGHT β
Copyright (c) 2003 Eugene van der Pijll. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
π₯ SEE ALSO π₯
DateTimedatetime@perl.orgmailing list
and that's the whole page bestie, we ate and left no crumbs π ok bye love u, this was perl v5.34.0, dated 2022-06-13, from DateTi...:MacOS(3pm) πβ¨π
π¦ where this page comes from
- debian bookworm: libdatetime-format-epoch-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdatetime-format-epoch-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdatetime-format-epoch-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdatetime-format-epoch-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdatetime-format-epoch-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms