DateTi...och::JD(3pm)
β¨ NAME β¨
okay so bestie, welcome to DateTime::Format::Epoch::JD β the lil module that converts DateTimes to/from Julian Days π (yes that's the whole name, the header just squishes it down to DateTi...och::JD(3pm) because terminals are dramatic like that, and it lives in the User Contributed Perl Documentation, periodt).
π¦ SYNOPSIS π¦
here's the vibe, copy-paste away:
use DateTime::Format::Epoch::JD;
my $dt = DateTime::Format::Epoch::JD->parse_datetime( 2453244.5 );
# 2004-08-27T00:00:00
DateTime::Format::Epoch::JD->format_datetime($dt);
# 2453244.5
my $formatter = DateTime::Format::Epoch::JD->new();
my $dt2 = $formatter->parse_datetime( 2453244.5 );
# 2004-08-27T00:00:00
$formatter->format_datetime($dt2);
# 2453244.5
see how both paths give you the same glow-up? class-method style or make-your-own-formatter style, both iconic π
πΈ DESCRIPTION πΈ
so what does this actually do, bestie? it takes a DateTime object (or literally any object that can be converted into a DateTime object, no gatekeeping here) and converts it to the Julian Day number π₯
and what even is the Julian Day number? it's the number of days since noon U.T.C. on January 1, 4713 B.C. (Julian calendar). yes, B.C. as in before the vibes. it's giving ancient.
this time scale was originally proposed by John Herschel, and it's often used in astronomical calculations β (astronomers stay winning).
here are its sibling modules, the whole friend group:
DateTime::Format::Epoch::MJDβ implements the "modified Julian Day", starting at midnight U.T.C., November 17, 1858. this number is always 2,400,000.5 lower than the JD, and this count only uses five digits to specify a date between 1859 and about 2130 πDateTime::Format::Epoch::RJDβ implements the "reduced Julian Day", starting at noon U.T.C., November 16, 1858. this number is always 2,400,000 lower than the JD β¨DateTime::Format::Epoch::TJDβ implements the "truncated Julian Day", starting at midnight U.T.C., May 24, 1968. this number is always 2,440,000,5 lower than the JD. actually, there is another version of the TJD, defined as JD modulo 10,000. but that one is a bit harder to implement, so you'll have to do with this version of TJD. or don't use TJD's at all πDateTime::Format::Epoch::RataDieβ implements the Rata Die count, starting at January 1, 1 (Gregorian). this count is used byDateTime::Calendarprogrammers πDateTime::Format::Epoch::Lilianβ implements the Lilian count, named after Aloysius Lilian (a 16th century physician) and first used by IBM (a 19th century punched card machine manufacturer). this counts the number of days since the adoption of the Gregorian calendar. only days are counted, and October 15, 1584 is day 1 π
π METHODS π
most of the methods are the same as those in DateTime::Format::Epoch. the only difference is the constructor, bestie, that's it:
new()β constructor of the formatter/parser object. it has no parameters. zero. nada. just vibes π«Ά
π SUPPORT π
need a hand? support for this module is provided via the datetime@perl.org email list. see http://lists.perl.org/ for more details π
π AUTHOR π
Eugene van der Pijll <pijll@gmx.net> β legend behaviour, honestly.
π COPYRIGHT π
Copyright (c) 2004 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, legally speaking β¨
β SEE ALSO β
DateTimedatetime@perl.orgmailing list
and that's the whole page, bestie π this one came to you from perl v5.34.0, dated 2022-06-13, and the original footer said DateTi...och::JD(3pm) on both ends like a lil sandwich π₯ͺ go forth and convert some Julian Days, you absolute main character ππ¦
π¦ 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