3v4l.org

run code in 300+ PHP versions simultaneously
<?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)}"; } }
Output for git.master_jit, git.master, rfc.property-hooks
7 people in LA (USA), each looking at their computer to find the time and date: The American one sees: - Full: Thursday, December 5, 2024 at 7:02:01 PM Pacific Standard Time - Short: 12/5/24, 7:02 PM - Short date: 12/5/24 The Australian one sees: - Full: Thursday, 5 December 2024 at 7:02:01 pm Pacific Standard Time - Short: 5/12/24, 7:02 pm - Short date: 5/12/24 The British one sees: - Full: Thursday, December 5, 2024 at 7:02:01 PM Pacific Standard Time - Short: 12/5/24, 7:02 PM - Short date: 12/5/24 The Canadian one sees: - Full: Thursday, December 5, 2024 at 7:02:01 p.m. Pacific Standard Time - Short: 2024-12-05, 7:02 p.m. - Short date: 2024-12-05 The French Canadian one sees: - Full: jeudi 5 décembre 2024 à 19 h 02 min 01 s heure normale du Pacifique - Short: 24-12-05 19 h 02 - Short date: 24-12-05 The French one sees: - Full: jeudi 5 décembre 2024 à 19:02:01 heure normale du Pacifique nord-américain - Short: 05/12/2024 19:02 - Short date: 05/12/2024 The Japanese one sees: - Full: 2024年12月5日木曜日 19時02分01秒 アメリカ太平洋標準時 - Short: 2024/12/05 19:02 - Short date: 2024/12/05 7 people in New York (USA), each looking at their computer to find the time and date: The American one sees: - Full: Thursday, December 5, 2024 at 10:02:01 PM Eastern Standard Time - Short: 12/5/24, 10:02 PM - Short date: 12/5/24 The Australian one sees: - Full: Thursday, 5 December 2024 at 10:02:01 pm Eastern Standard Time - Short: 5/12/24, 10:02 pm - Short date: 5/12/24 The British one sees: - Full: Thursday, December 5, 2024 at 10:02:01 PM Eastern Standard Time - Short: 12/5/24, 10:02 PM - Short date: 12/5/24 The Canadian one sees: - Full: Thursday, December 5, 2024 at 10:02:01 p.m. Eastern Standard Time - Short: 2024-12-05, 10:02 p.m. - Short date: 2024-12-05 The French Canadian one sees: - Full: jeudi 5 décembre 2024 à 22 h 02 min 01 s heure normale de l’Est - Short: 24-12-05 22 h 02 - Short date: 24-12-05 The French one sees: - Full: jeudi 5 décembre 2024 à 22:02:01 heure normale de l’Est nord-américain - Short: 05/12/2024 22:02 - Short date: 05/12/2024 The Japanese one sees: - Full: 2024年12月5日木曜日 22時02分01秒 アメリカ東部標準時 - Short: 2024/12/05 22:02 - Short date: 2024/12/05 7 people in Paris (FR), each looking at their computer to find the time and date: The American one sees: - Full: Friday, December 6, 2024 at 4:02:01 AM Central European Standard Time - Short: 12/6/24, 4:02 AM - Short date: 12/6/24 The Australian one sees: - Full: Friday, 6 December 2024 at 4:02:01 am Central European Standard Time - Short: 6/12/24, 4:02 am - Short date: 6/12/24 The British one sees: - Full: Friday, December 6, 2024 at 4:02:01 AM Central European Standard Time - Short: 12/6/24, 4:02 AM - Short date: 12/6/24 The Canadian one sees: - Full: Friday, December 6, 2024 at 4:02:01 a.m. Central European Standard Time - Short: 2024-12-06, 4:02 a.m. - Short date: 2024-12-06 The French Canadian one sees: - Full: vendredi 6 décembre 2024 à 04 h 02 min 01 s heure normale d’Europe centrale - Short: 24-12-06 04 h 02 - Short date: 24-12-06 The French one sees: - Full: vendredi 6 décembre 2024 à 04:02:01 heure normale d’Europe centrale - Short: 06/12/2024 04:02 - Short date: 06/12/2024 The Japanese one sees: - Full: 2024年12月6日金曜日 4時02分01秒 中央ヨーロッパ標準時 - Short: 2024/12/06 4:02 - Short date: 2024/12/06 7 people in Brisbane (Aus), each looking at their computer to find the time and date: The American one sees: - Full: Friday, December 6, 2024 at 1:02:01 PM Australian Eastern Standard Time - Short: 12/6/24, 1:02 PM - Short date: 12/6/24 The Australian one sees: - Full: Friday, 6 December 2024 at 1:02:01 pm Australian Eastern Standard Time - Short: 6/12/24, 1:02 pm - Short date: 6/12/24 The British one sees: - Full: Friday, December 6, 2024 at 1:02:01 PM Australian Eastern Standard Time - Short: 12/6/24, 1:02 PM - Short date: 12/6/24 The Canadian one sees: - Full: Friday, December 6, 2024 at 1:02:01 p.m. Australian Eastern Standard Time - Short: 2024-12-06, 1:02 p.m. - Short date: 2024-12-06 The French Canadian one sees: - Full: vendredi 6 décembre 2024 à 13 h 02 min 01 s heure normale de l’Est de l’Australie - Short: 24-12-06 13 h 02 - Short date: 24-12-06 The French one sees: - Full: vendredi 6 décembre 2024 à 13:02:01 heure normale de l’Est de l’Australie - Short: 06/12/2024 13:02 - Short date: 06/12/2024 The Japanese one sees: - Full: 2024年12月6日金曜日 13時02分01秒 オーストラリア東部標準時 - Short: 2024/12/06 13:02 - Short date: 2024/12/06

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
25.02 ms | 425 KiB | 5 Q