简体   繁体   中英

Display timezone name in Laravel

I want to display Timezone name while displaying date and time, I managed to display date time:

my code:

Carbon\Carbon::parse($notes->created_at)->format('F d Y H:i:s')

May 31 2018 18:50:08

I wanna display like:

May 31 2018 18:50:08 +GMTxxx

How do i do that?

The e flag will do what you are asking:

e | Timezone identifier (added in PHP 5.1.0) | Examples: UTC, GMT, Atlantic/Azores

Live Example

Repl

Reading Material

date

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM