@ 2024-05-09T12:13:10Z <?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)}";
}
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 8.4.1 0.011 0.004 24.55 8.3.14 0.010 0.021 23.46 8.3.13 0.007 0.007 23.56 8.3.12 0.004 0.011 23.98 8.3.11 0.003 0.014 23.46 8.3.10 0.000 0.017 24.06 8.3.9 0.009 0.006 26.77 8.3.8 0.010 0.010 22.00 8.3.7 0.036 0.018 21.75 8.3.6 0.011 0.021 21.88 8.3.5 0.016 0.023 21.72 8.3.4 0.035 0.016 22.13 8.2.26 0.010 0.007 22.21 8.2.25 0.016 0.013 21.94 8.2.24 0.006 0.010 22.23 8.2.23 0.006 0.010 22.58 8.2.22 0.009 0.006 37.54 8.2.21 0.007 0.028 26.77 8.2.20 0.007 0.018 22.13 8.2.19 0.020 0.030 21.63 8.2.18 0.022 0.010 23.75 8.2.17 0.021 0.014 24.13 8.1.31 0.010 0.026 22.09 8.1.30 0.009 0.006 21.28 8.1.29 0.006 0.012 30.84 8.1.28 0.006 0.026 23.18
preferences:dark mode live preview
26.07 ms | 403 KiB | 5 Q