DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Local Time & Date

04.17.2006
| 3350 views |
  • submit to reddit
        // description of your code here

<?php
$timezone = "the UK";
$time_diff = "0";
$alter = ($time_diff * 60 * 60);
$date_today = date ("l F jS Y", time () + $alter);
$time_now = date ("h:ia", time () + $alter);

echo "It's currently <strong>$time_now</strong> on <strong>$date_today</strong> in <strong>$timezone</strong>.";
?>