Astronomical
NAME
Date::Calendar::Persian::Astronomical - Conversions from / to the astronomical Persian calendar
SYNOPSIS
Converting a Gregorian date (e.g. 16th February 2021) into Persian
use Date::Calendar::Persian::Astronomical;
my Date $dt-greg;
my Date::Calendar::Persian::Astronomical $dt-persian;
$dt-greg .= new(2021, 2, 16);
$dt-persian .= new-from-date($dt-greg);
say $dt-persian;
# --> 1399-11-28
say $dt-persian.strftime("%A %d %B %Y");
# --> Yek-shanbe 28 Bahman 1399
Converting a Persian date (e.g. 1 Farvardin 1400) into Gregorian
use Date::Calendar::Persian::Astronomical;
my Date::Calendar::Persian::Astronomical $dt-persian;
my Date $dt-greg;
$dt-persian .= new(year => 1400, month => 1, day => 1);
$dt-greg = $dt-persian.to-date;
say $dt-greg;
# --> 2021-03-21
Conversion with a calendar which defines days as sunset to sunset
use Date::Calendar::Strftime;
use Date::Calendar::Hebrew;
use Date::Calendar::Persian::Astronomical;
my Date::Calendar::Persian::Astronomical $d-pe;
my Date::Calendar::Hebrew $d-he;
$d-pe .= new(year => 1403, month => 8, day => 23, daypart => before-sunrise);
$d-he .= new-from-date($d-pe);
say $d-he.strftime("%A %d %B %Y");
# ---> "Yom Reviʻi 12 Heshvan 5785"
$d-pe .= new(year => 1403, month => 8, day => 23, daypart => daylight);
$d-he .= new-from-date($d-pe);
say $d-he.strftime("%A %d %B %Y");
# ---> "Yom Reviʻi 12 Heshvan 5785" again
$d-pe .= new(year => 1403, month => 8, day => 23, daypart => after-sunset);
$d-he .= new-from-date($d-pe);
say $d-he.strftime("%A %d %B %Y");
# ---> "Yom Chamishi 13 Heshvan 5785" instead of "Yom Reviʻi 12 Heshvan 5785"
DESCRIPTION
Date::Calendar::Persian::Astronomical is a class representing dates in the astronomical Persian calendar. It allows you to convert a Persian date into Gregorian or into other implemented calendars, and it allows you to convert dates from Gregorian or from other calendars into Persian.
The distribution provides also the Date::Calendar::Persian class which gives the arithmetic version of the Persian calendar.
The astronomical Persian calendar is only partially implemented. It can represent dates only in the 1000 to 1800 years (1621 to 2421 in the Gregorian calendar).
Everything else is similar to the main class,
Date:::Calendar::Persian, so you should read the documentation for
this class.
SEE ALSO
Raku Software
Date::Calendar::Strftime or https://github.com/jforget/raku-Date-Calendar-Strftime
Date::Calendar::Gregorian or https://github.com/jforget/raku-Date-Calendar-Gregorian
Date::Calendar::Julian or https://github.com/jforget/raku-Date-Calendar-Julian
Date::Calendar::Hebrew or https://github.com/jforget/raku-Date-Calendar-Hebrew
Date::Calendar::Hijri or https://github.com/jforget/raku-Date-Calendar-Hijri
Date::Calendar::CopticEthiopic or https://github.com/jforget/raku-Date-Calendar-CopticEthiopic
Date::Calendar::MayaAztec or https://github.com/jforget/raku-Date-Calendar-MayaAztec
Date::Calendar::FrenchRevolutionary or https://github.com/jforget/raku-Date-Calendar-FrenchRevolutionary
Date::Calendar::Bahai or https://github.com/jforget/raku-Date-Calendar-Bahai
Perl 5 Software
Other Software
date(1), strftime(3)
calendar/cal-persia.el in emacs or xemacs.
CALENDRICA 4.0 -- Common Lisp, which can be download in the "Resources" section of https://www.cambridge.org/us/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition?format=PB&isbn=9781107683167
https://api.kde.org/frameworks-api/frameworks-apidocs/frameworks/kdelibs4support/html/kcalendarsystemjalali_8cpp_source.html Since the KDE version number will change, you should rather use a search engine: https://html.duckduckgo.com/html/?q=calendarsystemjalali%20KDElibs
Book
Calendrical Calculations (Third or Fourth Edition) by Nachum Dershowitz and Edward M. Reingold, Cambridge University Press, see http://www.calendarists.com or https://www.cambridge.org/us/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition?format=PB&isbn=9781107683167.
Internet
https://www.funaba.org/cc (which seems no longer active)
https://en.wikipedia.org/wiki/Iranian_calendars
AUTHOR
Jean Forget <J2N-FORGET at orange dot fr>
COPYRIGHT AND LICENSE
Copyright (c) 2021, 2024 Jean Forget, all rights reserved.
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.