Apoya a Time.now: Únete a nuestro Plan Premium ¡para una experiencia sin anuncios! Apóyanos: ¡Hazte Premium sin anuncios!
Backend Guía

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.";
}
?>

¿Por qué usar Time.Now para Backend?

  • Compatible with `json_decode`
  • Zero external dependencies
  • Lightweight response for fast rendering
Referencia de la API Ver todas las guías