Created
December 18, 2022 15:44
-
-
Save ekm507/7c3d2c9e1191cac824c6058da00c8a33 to your computer and use it in GitHub Desktop.
jalali to gregorian convert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Jalali to Gregorian convert. cli tool. | |
# usage: j2g.py 1401 11 12 | |
# to use, first install jdatetime lib using pip: | |
# pip install jdatetime | |
import jdatetime as j | |
from sys import argv | |
jdate_str = argv[1:4] | |
jy, jm, jd = map(int, jdate_str) | |
jdate = j.JalaliToGregorian(jy, jm, jd) | |
print(jdate.gyear, jdate.gmonth, jdate.gday) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment