DateTime::Infinite(3)

✨ NAME ✨

okay so bestie, welcome to the DateTime::Infinite(3) page from User Contributed Perl Documentation πŸ’… this one's all about DateTime::Infinite β€” literally infinite past and future DateTime objects, no cap πŸ•°οΈβœ¨


🌸 VERSION 🌸

version 1.65 β€” periodt, that's the one we're on πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

my $future = DateTime::Infinite::Future->new;
my $past   = DateTime::Infinite::Past->new;

like, that's the whole vibe. two lines, two infinities, slay ✨


πŸŽ€ DESCRIPTION πŸŽ€

This module gives you two DateTime subclasses, bestie:

  • DateTime::Infinite::Future β€” the far, far future πŸ”₯
  • DateTime::Infinite::Past β€” the deeply ancient past πŸ’€

and here's the thing: the objects are always in the "floating" timezone, and you literally cannot change that. it's giving immutable energy, iykyk 🫢


πŸ’… METHODS πŸ’…

The only constructor for these two classes is the new method, just like the "SYNOPSIS" shows. and it takes no parameters β€” zero, zilch, nada πŸ™ˆ

All the "get" methods in this module simply return infinity, positive or negative. If the method is expected to return a string, it returns the string representation of positive or negative infinity that your system uses. for example, on my system calling $dt->year returns a number which when printed appears either "Inf" or "-Inf" 😭 iconic honestly

This also applies to methods that are compound stringifications β€” they return the same strings even for things like $dt->ymd or $dt->iso8601. so yeah, $dt->ymd is out here giving "Inf" energy too, no cap πŸ’€

The object is not mutable, so these methods are all do-nothing methods that simply return the object they're called with:

  • $dt->set
  • $dt->set_time_zone
  • $dt->truncate

like, they literally just hand you back the same object. not me expecting them to do something 😭 they said "no changes, bestie" and meant it πŸ’…

Obviously, the $dt->is_finite method returns false and the $dt->is_infinite method returns true. as it should β€” the vibe check passes βœ…


🌈 SEE ALSO 🌈

  • datetime@perl.org mailing list β€” the group chat for DateTime stans πŸ’Œ

πŸ’€ BUGS πŸ’€

okay so there seem to be lots of problems when dealing with infinite numbers on Win32 😬 this may be a problem with this code, Perl, or Win32's IEEE math implementation. either way, the module may not be well-behaved on Win32 operating systems. so like, fair warning bestie 🫢

Bugs may be submitted at <https://github.com/houseabsolute/DateTime.pm/issues> β€” the GitHub issues page, go off πŸ‘‘

There's a mailing list available for users of this distribution, <mailto:datetime@perl.org> β€” pull up, say hi πŸ’–


⭐ SOURCE ⭐

The source code repository for DateTime can be found at <https://github.com/houseabsolute/DateTime.pm>. go browse, it's giving main character repo energy 🌟


πŸ‘‘ AUTHOR πŸ‘‘

Dave Rolsky <autarch@urth.org> β€” the icon, the legend, the author πŸ’œ


This software is Copyright (c) 2003 - 2023 by Dave Rolsky.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

The full text of the license can be found in the LICENSE file included with this distribution. read it, bestie, it's important πŸ“œβœ¨


and that's the whole page, fr fr πŸ’– this was perl v5.42.0, dated 2024-03-08, and it's the DateTime::Infinite(3) manpage β€” now go forth and vibe with infinity πŸ§šβ€β™€οΈπŸŒŒ

πŸ“¦ where this page comes from