Hijri(3pm)

πŸ“¦
version 0.02 Β· 2 versions
  • 0.02 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.02 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 (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