Easy way to use the google timezone api

Downloads in past


401.0.18 years ago8 years agoMinified + gzip package size for google-timezone-api in KB



module.exports(uOpts, callback) ⏏

You can use this module via promises or by using a callback.
The first parameter passed is an object which corresponds to variables you'd pass to the google time zone api.
An example options object:
		location: '43.7182713,-79.3777061', // REQUIRED: location you'd like to get timezone info for
		timestamp: '10000', // OPTIONAL: Timestamp which is used to calculate daylight savings if omitted will be used
		key: 'your api key', // OPTIONAL: You may want to pass in an API key. However it's optional.
		language: 'en' // OPTIONAL: Language of the returned data
This module can be used both in Node and in the browser via Browserify.
Visit for more info.
form of callback( err, result )  
Returns: Promise - This function will return a promise from which you can consume the resulting data
var timezone = require( '../' );

timezone( {

	location: '43.7182713,-79.3777061'
}).then( function( result ) {

	console.log( result );
}).catch( function( err ) {

	console.log( err );