Converting date from Hijri/Islamic Calendar to Georgian calendar

心已入冬 提交于 2021-01-29 09:52:58

问题


Im trying to convert a date in this format (1 بهمن 1397) into a Georgian calendar datetime. I'm using dateparser and I keep getting the type error: "'<=' not supported between instances of 'str' and 'int'". This is the relevant part of the script:

date = HijriCalendar(u'24 دی 1397').get_date()
print(date)

回答1:


The date is not Hijri/Islamic date(Lunar), it is Iranian date(Solar) en.wikipedia.org/wiki/Iranian_calendars. You should search for persian/iranian/khorshidi/jalali calendars.

Khayyam3 is a library to use date & time in persian style(known as Jalali calendar or khayyam alg) https://pypi.org/project/Khayyam3/



来源:https://stackoverflow.com/questions/54368860/converting-date-from-hijri-islamic-calendar-to-georgian-calendar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!