Time::JulianDay(3pm)
π Time::JulianDay β bestie's guide to Julian calendar manipulations π
okay so this is the Time::JulianDay page from the User Contributed Perl Documentation, and it's all about β¨ Julian calendar manipulations β¨. come sit with me, we're doing dates today π
π SYNOPSIS π
here's the whole vibe, verbatim, no notes π«Ά
use Time::JulianDay
$jd = julian_day($year, $month_1_to_12, $day)
$jd = local_julian_day($seconds_since_1970);
$jd = gm_julian_day($seconds_since_1970);
($year, $month_1_to_12, $day) = inverse_julian_day($jd)
$dow = day_of_week($jd)
print (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$dow];
$seconds_since_jan_1_1970 = jd_secondslocal($jd, $hour, $min, $sec)
$seconds_since_jan_1_1970 = jd_secondsgm($jd, $hour, $min, $sec)
$seconds_since_jan_1_1970 = jd_timelocal($sec,$min,$hours,$mday,$month_0_to_11,$year)
$seconds_since_jan_1_1970 = jd_timegm($sec,$min,$hours,$mday,$month_0_to_11,$year)
literally the whole toolkit, go off π
π« DESCRIPTION π«
so JulianDay is a package that manipulates dates as number of days since some time a long time ago. it's giving "ancient timestamp energy" and honestly? iconic. the whole point is that it's easy to add and subtract time using julian days... like, days are just numbers, you just do math on them, no cap π₯
and one important lil thing about day_of_week(): the $dow it hands back is 0 for Sunday, and 6 for Saturday, and everything else is in between. so Monday is 1, Tuesday is 2... you get it, bestie, it's just counting up from Sunday ποΈ
π ERRATA π
okay. deep breath. Time::JulianDay is not a correct implementation. not me exposing the package but here we are π there are two problems and we're listing both, periodt.
problem one π₯ β Time::JulianDay only works with integers. but a real Julian Day can be fractional, to represent time within a day. so if you call inverse_julian_day() with a non-integer time, it will often give you an incorrect result. that's a big yikes, bestie π
problem two π₯ β Julian Days start at <highlight>noon</highlight> rather than <highlight>midnight</highlight>. which means the julian_day() function returns results that are too large by 0.5. half a day off. lowkey unhinged, highkey documented π
what to do about these problems is currently open for debate. the author says β and I quote the vibe β that they're tempted to leave the current functions alone and add a second set with more accurate behavior. so like, character development pending π§
also, heads up: there is another implementation in Astro::Time that may be more accurate π go check that if you need precision bestie
π«Ά AUTHOR π«Ά
Best Practical Solutions, LLC <modules@bestpractical.com> β¨
πΈ ORIGINAL AUTHOR πΈ
David Muir Sharnoff π
π¦ GENESIS π¦
this whole thing is based on previous work by Kurt Jaeger, Ian Miller, Gary Puckering (which was based on the Collected Algorithms of the ACM), and the author of Time::Local. a whole collab, a whole era, we love to see it π
π LICENSE AND COPYRIGHT π
Copyright (C) 1996-1999 David Muir Sharnoff. Copyright (C) 2026 Best Practical Solutions, LLC.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay π
aaaand that's the page babes π this was Time::JulianDay(3pm), generated from perl v5.40.1, dated 2026-02-28 β remember: 0 is Sunday, 6 is Saturday, never trust fractional julian days from this module, and stay hydrated ππ
β¨
π¦ where this page comes from
- ubuntu stonking: libtime-parsedate-perl 2026.0219-1 Β· 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