Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Get current time in UK, USA...

Featured Replies

My PHP is not great at the best of times and I'm struggling to get the current time for the following countries;

UK

U.S.A.

Europe (Continent)

Canada

Switzerland

Australia

New Zealand

China

Japan

 

Any ideas how I would go about it?

  • Author

I'm trying to include this in a Wordpress page (using the HTML editor) but it won't run the

<script type="text/javascript">
new showLocalTime("timecontainer", "server-ssi", -60, "short")
</script>

 

Any ways around this?

  • Author

I have came up with this;

<?php
date_default_timezone_set('Australia/Melbourne');
$date = date('G:i', time());
echo $date;
?>

Will this work for each country? All I need to do is display the current time in each of the countries.

 

Obviously change the default timezone to each country, if there all available :S

Edited by lozenges

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.