POST

Time Zone with DST

Retrieve timezone information for a geographical location, including its UTC offset and daylight saving time (DST) details. Use accurate timezone data to convert local birth times and support reliable date and time calculations in astrology applications.

/timezone-with-dst
Method
POST
Format
JSON
Auth
API Key
Credits
1

Overview

The Time Zone with DST API returns the timezone offset and daylight saving time (DST) status for a specified local date and time in an IANA time zone. This is useful when converting local birth times into accurate timezone-aware values for astrology calculations and other date-sensitive applications.

The response includes the timezone identifier, UTC offset in minutes, UTC offset in hours, a formatted offset string, and a boolean indicating whether daylight saving time is active. These fields help developers determine the applicable timezone offset for a particular date rather than relying on a fixed offset that may change seasonally.

To use the API, send a POST request with the IANA timezone identifier, year, month, day, hour, and minute. For example, you can provide Europe/Paris and a local date and time to retrieve the applicable offset and DST status. The API returns the result in JSON format for integration into websites, mobile applications, and astrology software.

Request Parameters

Parameter Type Required Description Example
timezone
string Yes Valid time zone of IANA Time Zone identifiers format Europe/Paris
year
integer Yes Valid year 2026
month
integer Yes Valid month number,with no leading zero 7
day
integer Yes Valid day number, with no leading zero 3
hour
integer Yes Valid hour number, with no leading zero 3
minute
integer Yes Valid Minutes number, with no leading zero 9

Request Example

    {
        "timezone": "Europe/Paris",
        "year": 2026,
        "month": 7,
        "day": 29,
        "hour": 2,
        "minute": 30
    }

Response Examples

Example responses returned by this API.

English Response
{
    "statusCode": 200,
    "timezone_with_dst": {
        "timezone": "Europe/Paris",
        "timezone_offset_minutes": 120,
        "timezone_offset_hours": 2.0,
        "timezone_offset_str": "+02:00",
        "is_dst": true
    }
}

Code Examples

Use the following examples to integrate this API into your application.

PHP Code
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://json.freeastrologyapi.com/timezone-with-dst',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "timezone": "Europe/Paris",
  "year": 2026,
  "month": 7,
  "day": 29,
  "hour": 2,
  "minute": 30
}
',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'x-api-key: YOUR_API_KEY_HERE'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Python Code
import requests
import json

url = "https://json.freeastrologyapi.com/timezone-with-dst"

payload = json.dumps({
  "timezone": "Europe/Paris",
  "year": 2026,
  "month": 7,
  "day": 29,
  "hour": 2,
  "minute": 30
})
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'YOUR_API_KEY_HERE'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
Node JS Code
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://json.freeastrologyapi.com/timezone-with-dst',
  'headers': {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY_HERE'
  },
  body: JSON.stringify({
    "timezone": "Europe/Paris",
    "year": 2026,
    "month": 7,
    "day": 29,
    "hour": 2,
    "minute": 30
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});