DateTi...:MacOS(3pm)

πŸ“¦
version 0.16 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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 (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 πŸ”₯

  • DateTime
  • datetime@perl.org mailing 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