Soutenez Time.now : Rejoignez notre Plan Premium pour une expérience sans publicité ! Soutenez-nous : Passez Premium sans pub !
Backend Guide

Get World Time in PHP

PHP servers often rely on the configured server time, which may differ from your users' actual location. By fetching our JSON API, you can display precise local times dynamically without changing server configs.

PHP
<?php
$timezone = "Europe/London";
$url = "https://time.now/developer/api/timezone/" . $timezone;

// Fetch JSON data
$json = file_get_contents($url);
$data = json_decode($json, true);

if ($data) {
    echo "Current time in " . $data['timezone'] . ": " . $data['datetime'];
    echo "<br>Unix Timestamp: " . $data['unixtime'];
} else {
    echo "Failed to fetch time data.";
}
?>

Pourquoi utiliser Time.Now pour Backend ?

  • Compatible with `json_decode`
  • Zero external dependencies
  • Lightweight response for fast rendering
Référence API Guide d'installation