Introduction to SmartMaps Timezone
SmartMaps Timezone is a simple and efficient library that allows you to interact with the SmartMaps Timezone API. It provides a convenient way to retrieve detailed timezone information for any geographical location, enabling you to enhance your applications with precise temporal context.
Key Features
-
Real-Time Timezone Information: Access accurate and up-to-date timezone data for any point on the globe by providing latitude and longitude coordinates. Retrieve comprehensive information, including the current timezone, local time, and UTC offset.
-
Daylight Saving Time Support: Easily determine whether a location is currently observing daylight saving time. The API returns detailed information about the timezone's daylight saving status, allowing you to adjust your application's time calculations accordingly.
-
Sunrise and Sunset Times: In addition to timezone data, the API can provide sunrise and sunset times for any given location. This feature is particularly useful for applications that require solar data, such as weather forecasting, photography planning, or outdoor activity scheduling.
Getting Started
To start using SmartMaps Timezone:
-
Install the library via npm:
-
Import the
Timezone
class from the package: -
Create a new
Timezone
instance with your API key: -
Use the available methods to retrieve timezone data:
Supported Endpoints
SmartMaps Timezone provides the following endpoints:
-
Current Timezone API (current/point): Takes latitude, longitude, and other parameters to return the current timezone for a specific location. Useful when you want to know the timezone of a geographical point.
-
Convert Timezone API (convert/point): Converts time from one timezone to another. Takes parameters like date-time, latitude, longitude, or timezone ID, and returns the time in the target timezone.
Timezone API Reference
The SmartMaps Timezone API offers a comprehensive set of endpoints for retrieving and converting timezone data. Here are the main endpoints:
-
Get Current Timezone at a Point: Retrieves current timezone data for a specific geographic point using a GET request.
-
Get Current Timezone for Multiple Points: Retrieves current timezone data for multiple geographic points using a POST request.
-
Convert Timezone for a Point: Converts timezone data for a specific geographic point and date-time using a GET request.
-
Convert Timezone for Multiple Points: Converts timezone data for multiple geographic points and date-times using a POST request.
With SmartMaps Timezone, you can easily integrate timezone functionality into your Node.js applications, ensuring accurate and reliable temporal data for any geographical location.