DateTi...h::MJD(3pm)
π NAME π
DateTime::Format::Epoch::MJD β bestie, it converts DateTimes to and from Modified Julian Days. That's it, that's the whole gig π
This one lives in the User Contributed Perl Documentation section of your manual, btw, so you know it's community-made and community-loved π«Ά
β¨ SYNOPSIS β¨
okay so here's the whole vibe in code, no cap:
use DateTime::Format::Epoch::MJD;
my $dt = DateTime::Format::Epoch::MJD->parse_datetime( 53244 );
# 2004-08-27T00:00:00
DateTime::Format::Epoch::MJD->format_datetime($dt);
# 53244
my $formatter = DateTime::Format::Epoch::MJD->new();
my $dt2 = $formatter->parse_datetime( 53244 );
# 2004-08-27T00:00:00
$formatter->format_datetime($dt2);
# 53244
look at that. 53244 in, 2004-08-27T00:00:00 out. and back again. iconic behaviour, honestly π
πΈ DESCRIPTION πΈ
so this module takes a DateTime object β or literally anything that can be converted into a DateTime object, it's not picky β and turns it into a Modified Julian Day number. and yes it goes the other way too, it's a whole two-way street π¦
for the full β¨loreβ¨ on how it works, go read DateTime::Format::Epoch::JD β it has the description. this page is basically the MJD-flavoured sibling.
π METHODS π
most of the methods here are the exact same as the ones in DateTime::Format::Epoch. like, no changes, same energy. the only glow-up is the constructor:
new()β this is your constructor for the formatter/parser object. it takes no parameters. none. zero. empty. it just exists and does its thing, main character energy π
π«Ά SUPPORT π«Ά
need help? got questions? the support for this module comes through the datetime@perl.org email list. head to http://lists.perl.org/ for more deets π
π AUTHOR π
Eugene van der Pijll <pijll@gmx.net> β thank you for your service, king/queen/royalty π«‘π
π 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. β¨ (yes bestie, free software, go wild, but respect the terms fr fr)
π₯ SEE ALSO π₯
- DateTime
- the
datetime@perl.orgmailing list
and that's a wrap!! this page came to you courtesy of perl v5.34.0 and it was dated 2022-06-13 β so if you're reading this, hey, it's still serving π mwah, go parse some dates π¦β
π¦ 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