SO-ChatBot icon indicating copy to clipboard operation
SO-ChatBot copied to clipboard

Time command

Open mainerror opened this issue 12 years ago • 8 comments

This should be a low priority feature.

I think it could be useful to have a !!time [location|ISO 8601 time zone designators] command.

Here's how it would work:

  • in case no city name or a ISO 8601 time zone designator is provided it assumes and returns UTC time
  • in case a city is provided it looks up and returns the time zone for the given city1
  • in case an ISO 8601 time zone designator is provided it returns the appropriate time2

Footnotes

  1. Obviously that requires an appropriate API, if you know of an API that provides the described functionality please post a link.
  2. This does not necessarily require an API, one could fetch the UTC time and return it ± the offset.

mainerror avatar Jul 28 '13 23:07 mainerror

Seems somewhat useful, sure.

Shmiddty avatar Jul 29 '13 15:07 Shmiddty

:+1:

https://developers.google.com/maps/documentation/timezone/

ralt avatar Jul 29 '13 15:07 ralt

The problem is finding a decent API. Things like @Ralt show require (lat,lng) which are quite not what we're looking for, and the scarce few who do search by city cost monies (I'm a freeloader).

If this ever moves to node though whistles nervously, we'll have a tz database (/usr/share/zoneinfo), which is at least something.

Zirak avatar Jul 29 '13 16:07 Zirak

with google reverse geo mapping? !!time Honolulu

caub avatar Jul 31 '13 11:07 caub

Why would we need to use an API? Just using TimeZones should be enough. No one needs to search by city. Then it's just a simple timestamp changed per timezone.

FirstWhack avatar Aug 02 '13 03:08 FirstWhack

the more cool thing would be to query it for user, !!time Zirak and have a result of its timezoned time, based on an algorithm that checks its active hours :)

caub avatar Aug 02 '13 08:08 caub

@Jhawins Simple example. Without looking it up, what timezone is Tokyo or Mumbai in? See?

@cx11 Maybe in a later iteration, the important functionality would be to get it per city.

mainerror avatar Aug 02 '13 09:08 mainerror

Does this look good enough?

Zirak avatar Aug 02 '13 09:08 Zirak