chubin / pyphoon

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

Add timezone option #33

Open martinbra opened 3 years ago

martinbra commented 3 years ago

Created from https://github.com/chubin/wttr.in/issues/56 To correctly show delta time to last and next phase, and the correct phase at the days when there's a phase change, a timezone option is needed.

chubin commented 3 years ago

A small addition:

Timezone must specified in the standard format understandable by pytz, e.g. Europe/London, to that this could work:

pytz.timezone(tiimezone_description)

It should return a short error message for unknown timezones

martinbra commented 3 years ago

@chubin : What is your timezone/UTC offset? I'm at America/Sao_Paulo (UTC-03) and it looks like that pyphoon is indeed using my local time when displaying the next moon phases (well, a few minutes off comparing to this site).

>pyphoon 2020-08-20
New Moon +     
1  0:17:44     
First Quarter -
5 14:59:11     

Timezone option added to my branch with a simple display of provided timezone (or UTC by default) if you want to check error messages and/or give suggestions. Timezone is still not being used.

martinbra commented 3 years ago

self-reminder: take a look at negative time at http://wttr.in/moon@2020-08-19

chubin commented 3 years ago

@martinbra Martin, I am going through old issues: do we have something to do here?

martinbra commented 3 years ago

Yes we (I) do. I'm sorry to have left this issue frozen. I think something is broken here (just reproduced): image

Do you see the negative time? What could be causing it? As for the timezone option, I know I have advanced something in my fork, but I'm not sure if I pushed everything to github. I'll have a look.