khayyam
khayyam copied to clipboard
A Persian Date & Time (aka: Jalali Calendar) library with timezone, DST (daylight-saving), full formatting & parsing support for python 2.x & 3.x.
When the calendar switches from 1403 to 1404, all the dates are off by one day due to the leap year.
http://en.wikipedia.org/wiki/Leap_year
1403 [is a leap year](https://fa.wikipedia.org/wiki/%DB%B1%DB%B4%DB%B0%DB%B3_(%D8%AE%D9%88%D8%B1%D8%B4%DB%8C%D8%AF%DB%8C)), but the library fails to recongnize it as a leap year: ```python In [1]: from khayyam.algorithms_pure import is_jalali_leap_year In [2]: is_jalali_leap_year(1403) Out[2]: False ```
Since the general policy for Daylight saving time in Iran has been revoked, using ```TehranTimezone()``` function will return an incorrect answer starting 1/1/1402. ``` class TehranTimezone(Timezone): """ Tehran timezone with...
Code for issue #39
What to do with this warning?
File "/usr/local/lib/python3.7/site-packages/khayyam/jalali_datetime.py", line 399, in utcoffset return self.tzinfo.utcoffset(self) TypeError: utcoffset(dt) argument must be a datetime instance or None, not JalaliDatetime
the default datetime module return timetuple with hour, minute, and second but what JalaliDatetime.timetuple() returns doesn't have these three items, so sadly in my case I should make my timetuple...
%f zero padded example edited
python3 renamed __unicode__ to __str__