DateTi...h::Unix(3pm)

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

✨ NAME ✨

DateTime::Format::Epoch::Unix β€” bestie, it converts DateTimes to and from Unix epoch seconds. That's it. That's the whole vibe. πŸ’…

Oh and real quick β€” this page is from the DateTi...h::Unix(3pm) man page, the Perl doc section, so you know where you are. 🫢


🌸 SYNOPSIS 🌸

use DateTime::Format::Epoch::Unix;

my $dt = DateTime::Format::Epoch::Unix->parse_datetime( 1051488000 );
 # 2003-04-28T00:00:00

DateTime::Format::Epoch::Unix->format_datetime($dt);
 # 1051488000

my $formatter = DateTime::Format::Epoch::Unix->new();
my $dt2 = $formatter->parse_datetime( 1051488000 );
$formatter->format_datetime($dt2);

Look at that. Clean. Iconic. Two directions, one module. πŸ”₯


πŸ’– DESCRIPTION πŸ’–

Okay so here's the tea, bestie: this module takes a DateTime object β€” or honestly any object that can be converted to a DateTime object, it's not picky β€” and turns it into the number of seconds since the Unix epoch. And yes, it goes the other way too. No cap. πŸ’€

It's giving "tiny but mighty." πŸ¦‹


πŸŽ€ METHODS πŸŽ€

Most of the methods are literally the same</> as the ones in DateTime::Format::Epoch. The only difference? The constructor. That's the plot twist. 😭

  • new() β€” the constructor for the formatter/parser object. It has no parameters. Zero. None. She doesn't want them. πŸŽ€

πŸ’œ SUPPORT πŸ’œ

Need help? Support for this module comes through the datetime@perl.org email list. Go peek at http://lists.perl.org/ for more details. The people there are nice, I promise. 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Eugene van der Pijll <pijll@gmx.net> β€” the icon who made this. Respect. πŸ’…


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. Slay. ✨


🌈 SEE ALSO 🌈

  • DateTime β€” the main character, obviously. πŸ‘‘
  • the datetime@perl.org mailing list β€” your group chat for datetime emergencies. πŸ’Œ

okay that's the whole page, mwah πŸ’– This was DateTi...h::Unix(3pm) from perl v5.34.0, dated 2022-06-13 β€” love that for us. go forth and convert timestamps, bestie. πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from