<?php $timezones = [ 'LA (USA)' => 'America/Los_Angeles', 'New York (USA)' => 'America/New_York', 'Paris (FR)' => 'Europe/Paris', 'Brisbane (Aus)' => 'Australia/Brisbane', ]; $locales = [ 'American' => 'en-US', 'Australian' => 'en-AU', 'British' =>'en-UK', 'Canadian' => 'en-CA', 'French Canadian' => 'fr-CA', 'French' => 'fr-FR', 'Japanese' => 'ja-JP', ]; $absoluteDate = new DateTimeImmutable('2024-12-06T03:02:01.123456Z'); foreach ($timezones as $place => $tzName) { echo "\n\n7 people in {$place}, each looking at their computer to find the time and date:"; foreach ($locales as $nationality => $locale) { $fullFormatter = new IntlDateFormatter( $locale, IntlDateFormatter::FULL, IntlDateFormatter::FULL, new DateTimeZone($tzName) ); $shortFormatter = new IntlDateFormatter( $locale, IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, new DateTimeZone($tzName) ); $shortDateOnlyFormatter = new IntlDateFormatter( $locale, IntlDateFormatter::SHORT, IntlDateFormatter::NONE, new DateTimeZone($tzName) ); echo "\n The {$nationality} one sees: - Full: {$fullFormatter->format($absoluteDate)} - Short: {$shortFormatter->format($absoluteDate)} - Short date: {$shortDateOnlyFormatter->format($absoluteDate)}"; } }
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`