Hijri(3pm)
π Hijri β Date::Hijri β¨
okay bestie, listen up, this is a Perl extension that converts islamic (hijri) and gregorian dates back and forth, and it's part of the User Contributed Perl Documentation situation (it's a 3pm manual page, iykyk). it's smol, it's simple, it slays. π¦
πΈ NAME πΈ
Date::Hijri β the Perl extension that converts islamic (hijri) and gregorian dates, no cap. π
β¨ SYNOPSIS β¨
use Date::Hijri;
# convert gregorian to hijri date
my ($hd, $hm, $hy) = g2h($gd, $gm, $gy);
# convert hijri to gregorian date
my ($gd, $gm, $gy) = h2g($hd, $hm, $hy);
like, that's it. that's the whole vibe. π
π DESCRIPTION π
This simple module converts gregorian dates to islamic (hijri) and vice versa. literally both directions, we love a bidirectional icon. π
The dates must be given as an array containing the day, month and year, and it returns the corresponding date as a list with the same elements. so you hand it three numbers, you get three numbers back, in the same order, no drama. π«Ά
π₯ EXAMPLES π₯
okay so here's the moment you've been waiting for, the demo:
#!/usr/bin/perl -w
use Date::Hijri;
print join("-", g2h(22,8,2003)); # prints 23-6-1424
print join("-", h2g(23,6,1424)); # prints 22-8-2003
it's giving round trip. 22-8-2003 becomes 23-6-1424, and 23-6-1424 comes right back home to 22-8-2003. we love a conversion that knows the way back. π§
π SEE ALSO π
bestie, the tea is: this code is just stolen from KDE's kcalendarsystemhijri.cpp at
http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdelibs/kdecore/kcalendarsystemhijri.cpp
and here come the receipts, verbatim, because credit matters:
Copyright (c) 2002-2003 Carlos Moro <cfmoro@correo.uniovi.es>
Copyright (c) 2002-2003 Hans Petter Bieker <bieker@kde.org>
kcalendarsystemhijri.cpp is translated from the Lisp code
in ``Calendrical Calculations'' by Nachum Dershowitz and
Edward M. Reingold, Software---Practice & Experience,
vol. 20, no. 9 (September, 1990), pp. 899--928.
This code is in the public domain, but any use of it
should publically acknowledge its source.
so like, public domain, yes, but be a decent human and publically acknowledge its source, periodt. π―
π AUTHOR π
Alex Pleiner, <alex@zeitform.de> β the main character who brought you this module. π
π COPYRIGHT AND LICENSE π
Copyright (c) 2003 zeitform Internet Dienste. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. so like, same energy as Perl, go wild responsibly. π
π DISCLAIMER π
okay this is the part where we get real, because accuracy is the moment and I would never lie to you:
I haven't really tested if the converted dates are right and hope someone will point out mistakes. π«£ (yes, the author said that, and honestly? brave. iconic. we respect the honesty.)
Hijri calculations are very difficult. The islamic calendar is a pure lunar calendar, the new month starts by a physical (i.e. human) sighting of the crescent moon at a given locale. So it depends on several factors (like weather) that make it unreliable to calculate islamic calendars in advance. As a result the dates calculated by Date::Hijri can be false by one or more days. π
no cap, do not treat these conversions as gospel, they can be off by one or more days. the moon said what it said.
Please see http://www.rabiah.com/convert/introduction.html for further explanation. π
I'm not a muslim, but interested in Islamic culture, religion and calendar system. I believe in the Internet as a chance to realize that we live in a small world with multiple cultures, religions and philosophies. We can learn from others and develop tolerance, respect and understanding. πΈπ¦π
Salam Alaikum (peace be with you) π«Ά
and that's the whole page, bestie β this was the Hijri page from the User Contributed Perl Documentation, and the footer energy is perl v5.36.0, dated 2022-11-20. πβ¨π stay converting, stay kind, peace out. π§π
π¦ where this page comes from
- debian bookworm: libdate-hijri-perl 0.02-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdate-hijri-perl 0.02-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdate-hijri-perl 0.02-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdate-hijri-perl 0.02-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdate-hijri-perl 0.02-4 Β· 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