How to Get the Current Date and Time of a Location in Node.JS

When working with international partners or users, perfect timing is necessary. Setting up meetings, sending urgent correspondence, and making phone calls are all dependent upon the date and time at a specific location. For example, if an employee of a US company calls someone at an Australian organization, a Friday afternoon would be poor choice of time as it will already be Saturday in Australia. This API will help mitigate those kinds of risks by retrieving the current date and time of an input location.

Image for post
Image for post

To use this API, run this command to install the SDK:

npm install cloudmersive-validate-api-client --save

You can also add this snippet to your package.json:

"dependencies": {
"cloudmersive-validate-api-client": "^1.2.4"
}

Then, you can call the function:

var CloudmersiveValidateApiClient = require('cloudmersive-validate-api-client');
var defaultClient = CloudmersiveValidateApiClient.ApiClient.instance;

This will not only return the time at the desired location, but also the current time in GMT.

You can retrieve the API Key from the Cloudmersive website at no cost and with no commitment. This will provide you with 800 monthly calls across our library of APIs.

Written by

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store