swapagarwal / JARVIS-on-Messenger

:speech_balloon: A community-driven python bot that aims to be as simple as possible to serve humans with their everyday tasks
https://m.me/J.A.R.V.I.S.on.Messenger
MIT License
1.35k stars 988 forks source link

Jarvis is returning current time as Jan 1st 1970 00 hours #349

Open gibertoni opened 6 years ago

gibertoni commented 6 years ago

Description So far the time module has been working fine for me, except for Brazil. Whenever I ask the time in Brazil or a city within Brazil, it returns the default January 1st.

Steps to reproduce 1) Ask Jarvis on Messenger: "Time in Brazil" 2) Observe the answer:

Location: Brasil Time: Thu Jan 01 1970 00:00:00

Remakrs Running localy, I don't have this issue: {"text": "Location: Brazil\nTime: Sun Nov 19 2017 09:42:35 -03"}

isbee commented 6 years ago

How can test time module correctly in local? I applied #319, registered google api key with timezoneDB key(my own) and test time.py but i can't receive responses like yours.

My problem is getting location data works fine but getting time data does not. Seems like some exception is triggered while getting time data(any codes below request.get() are being skipped)

Also I'm curios about how the current query works correctly because sample queries in timezonedb.com are quiet different compare to ours.

image (https://timezonedb.com/references/get-time-zone)

image (modules/src/time.py)

gibertoni commented 6 years ago

Hi @isbee, I did not have trouble with the current requests for time. Try to debug again and see what exception is actually being thrown. It may be just an http error response from timezonedb, which may indicate exactly what is wrong with your key or request.

isbee commented 6 years ago

thank you @gibertoni :)

I solved the problem. as you said my request had been wrong. now query works fine.