chubin / pyphoon

:waning_gibbous_moon: ASCII Art Phase of the Moon (Python version)
http://wttr.in/Moon
MIT License
1.32k stars 93 forks source link

Pyphoon on windows cannot parse dates #44

Open kungfubeaner opened 9 months ago

kungfubeaner commented 9 months ago

I installed pyphoon on Arch Linux and on windows. On it works properly but on windows:

pyphoon 1960-04-02

says cannot parse date, but strangely later dates like 1980-10-31 or 1993-10-31 work fine. I'm guessing its an issue with python-dateutils on windows.

kungfubeaner commented 9 months ago

Tried to do some debugging on my own and this is where the issue happens:

Line 267 in init.py:

dateobj = time.mktime(dateutil.parser.parse("04/02/1960").timetuple())

Traceback (most recent call last): File "", line 1, in OverflowError: mktime argument out of range

It seems any date before the epoch is invalid. "01/01/1970"