molybdenum-99 / reality

Comprehensive data proxy to knowledge about real world
MIT License
818 stars 43 forks source link

Extras: time at geographic point #21

Closed zverok closed 8 years ago

zverok commented 8 years ago

Interface:

# minimal
Reality.city('Buenos-Aires').current_time # => 2016-01-11 06:38:51 -0300

# more:
Reality.city('Buenos-Aires').time(2015, 1, 11, 6, 38) # => 2016-01-11 06:38:00 -0300
Reality.city('Buenos-Aires').time('2015-01-11 06:38')  # => 2016-01-11 06:38:00 -0300

# or, better (?) alternative:
Reality.city('Buenos-Aires').time.zone
Reality.city('Buenos-Aires').time.now
Reality.city('Buenos-Aires').time.local(2015, 1, 11, 6, 38)
Reality.city('Buenos-Aires').time.parse('2015-01-11 06:38')

Implementation:

smostovoy commented 8 years ago

should wait for #3 and #17 ?

zverok commented 8 years ago

@smostovoy No, I don't think so. About #3 (which, in any case, I'll plan to do today/tomorrow) -- there is Country already, heaving time_zone field. About #17 -- it seems like earlier (and not well-thought) version of current ticket, let's ignore it for now.

zverok commented 8 years ago

NB: some (very rough) city data added.

zverok commented 8 years ago

Want something be done, do it yourself :( https://github.com/zverok/wheretz

smostovoy commented 8 years ago

ok, will change to use it)

zverok commented 8 years ago

Fixed with coord.timezone and TZOffset class