POST
Time Zone with DST
The timezone-with-dst gives DST and timezone offset for a given timezone and local datetime
/timezone-with-dst
Method
POST
Format
JSON
Auth
API Key
Credits
1
Overview
The timezone-with-dst gives DST and timezone offset for a given timezone and local datetimeRequest 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 |
montth
|
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);
});