Utilities
Get Current Date and Time
Get the current server date and time.
POST
/
v2
/
utils
/
current-date
Get Current Date and Time
curl --request POST \
--url https://api.blitz-api.ai/v2/utils/current-date \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"region": "America/New_York"
}
'import requests
url = "https://api.blitz-api.ai/v2/utils/current-date"
payload = { "region": "America/New_York" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({region: 'America/New_York'})
};
fetch('https://api.blitz-api.ai/v2/utils/current-date', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.blitz-api.ai/v2/utils/current-date",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'region' => 'America/New_York'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.blitz-api.ai/v2/utils/current-date"
payload := strings.NewReader("{\n \"region\": \"America/New_York\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.blitz-api.ai/v2/utils/current-date")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"region\": \"America/New_York\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blitz-api.ai/v2/utils/current-date")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"region\": \"America/New_York\"\n}"
response = http.request(request)
puts response.read_body{
"datetime": "2026-01-08 12:00:00 -05:00",
"timestamp": 1736385600,
"timezone": "America/New_York",
"timezone_name": "(GMT-05:00) New York"
}{
"success": false,
"error": {
"code": "INVALID_INPUT",
"message": "Missing required fields"
}
}{
"success": false,
"message": "this is a controlled error. created at 2025-07-11T10:20:00.000Z"
}
Agents & LLMs: a Markdown version of this page is available by appending .md to the URL, and the full documentation index is at llms.txt.
Cost: no cost
The timezone is specified in the
region parameter. The timezone must be a valid timezone string. You can find the list of valid timezone strings here.Authorizations
Your Blitz API Key. Get one from https://app.blitz-api.ai
Body
application/json
Example:
"America/New_York"
Response
OK
The response is of type object.
⌘I
Get Current Date and Time
curl --request POST \
--url https://api.blitz-api.ai/v2/utils/current-date \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"region": "America/New_York"
}
'import requests
url = "https://api.blitz-api.ai/v2/utils/current-date"
payload = { "region": "America/New_York" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({region: 'America/New_York'})
};
fetch('https://api.blitz-api.ai/v2/utils/current-date', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.blitz-api.ai/v2/utils/current-date",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'region' => 'America/New_York'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.blitz-api.ai/v2/utils/current-date"
payload := strings.NewReader("{\n \"region\": \"America/New_York\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.blitz-api.ai/v2/utils/current-date")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"region\": \"America/New_York\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blitz-api.ai/v2/utils/current-date")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"region\": \"America/New_York\"\n}"
response = http.request(request)
puts response.read_body{
"datetime": "2026-01-08 12:00:00 -05:00",
"timestamp": 1736385600,
"timezone": "America/New_York",
"timezone_name": "(GMT-05:00) New York"
}{
"success": false,
"error": {
"code": "INVALID_INPUT",
"message": "Missing required fields"
}
}{
"success": false,
"message": "this is a controlled error. created at 2025-07-11T10:20:00.000Z"
}
