Time by Time Zone - abstractive/timez GitHub Wiki

#Time by Time Zone

Get JSON response as a JSON Dictionary

Request

time = Timez.get_time('Asia/Colombo', 'YOUR_API_KEY')

Response

{"status"=>"OK", "message"=>"", "countryCode"=>"LK", "zoneName"=>"Asia/Colombo", "abbreviation"=>"IST", "gmtOffset"=>"19800", "dst"=>"0", "timestamp"=>1434394212}

Get UTC time

Request

time = Timez.get_time_utc('Asia/Colombo', 'YOUR_API_KEY')

Response

2015-06-15 18:51:15 UTC

Get time from timestamp

Request

time = Timez.get_time_zone('Asia/Colombo', 'YOUR_API_KEY')

Response

2015-06-16 00:24:05 +0530

Get timestamp

Request

time = Timez.get_time_timestamp('Asia/Colombo', 'YOUR_API_KEY')

Response

1434394557