转换日期从回历/伊斯兰历到格鲁吉亚历 [英] Converting date from Hijri/Islamic Calendar to Georgian calendar

查看:80
本文介绍了转换日期从回历/伊斯兰历到格鲁吉亚历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将这种格式(1بهمن1397)的日期转换为格鲁吉亚日历日期时间.我正在使用dateparser,并且不断收到类型错误:"str"和"int"的实例之间不支持'< ="".这是脚本的相关部分:

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)

推荐答案

日期不是回历(Hijri)/伊斯兰日期(Lunar),而是伊朗日期(Solar)en.wikipedia.org/wiki/Iranian_calendars.您应该搜索波斯语/伊朗语/khorshidi/jalali日历.

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是一个使用date&波斯风格的时间(称为Jalali日历或Khayyam Alg) https://pypi.org/project/Khayyam3/

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

这篇关于转换日期从回历/伊斯兰历到格鲁吉亚历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆