Saya memiliki proyek yang sebagian besar berbasis di wilayah CET. Saya mengatur CET di config/app.php, tetapi semua cap waktu pivot di basis disimpan dalam waktu UTC?
Bagaimana cara menyetel zona waktu "global" untuk stempel waktu?
saya membuat tes ini:
<?php
$timezone = date_default_timezone_get();
echo "The current server timezone is: " . $timezone;
echo "<br />".date('m/d/Y h:i:s a', time());
$mytime = Carbon\Carbon::now();
echo "<br />".$mytime->toDateTimeString();
?>
dan inilah hasilnya:
The current server timezone is: CET
06/09/2016 12:06:04 pm
2016-06-09 11:06:04
terima kasih Y
Carbon\Carbon::parse('2021-01-28T23:45:00.000000Z')->setTimezone('Europe/Brussels')->format('Y-m-d H:i')
=›"2021-01-29 00:45"
- person PaulH   schedule 28.01.2021