Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dataware's avatar

Laravel 10x & carbon & PHP 8.2.12 datetime format timezone name diferent servers

Hello

can you help me?

my localhost code:

dd((new \Carbon\Carbon())->format('Y-m-d H:i e'))

output console: 2024-01-26 16:27 UTC

email body text: 2024-01-26 16:27 UTC

my other test server code:

dd((new \Carbon\Carbon())->format('Y-m-d H:i e'))

output console: 2024-01-26 16:27 UTC

email body text: 2024-01-26 16:27 UTC

my prod server code:

dd((new \Carbon\Carbon())->format('Y-m-d H:i e'))

output console: 2024-01-26 16:27 UTC

email body text: 2024-01-26 16:27 Z

why change email body UTC -> Z???

this is net user friendly

0 likes
6 replies
jaseofspades88's avatar

You're not really explaining what the problem is. Z and UTC are the same timezone. It's Zulu time and a quick Google search would have told you this.

dataware's avatar

@jaseofspades88 yes i know but avg user and my boss request we write UTC not Z

and this problem only prod email body

dataware's avatar
dataware
OP
Best Answer
Level 1

solved

dd((new \Carbon\Carbon())->format('Y-m-d H:i e')->setTimezone('UTC'))
1 like

Please or to participate in this conversation.