I'm a bit confused as to why the date formatter T
does not always return a timezone abbreviation.
The following code Carbon::now()->timezone('Europe/London')->format('T')
returns 'BST', Carbon::now()->timezone('Europe/Stockholm')->format('T')
returns 'CEST', but Carbon::now()->timezone('Asia/Bangkok')->format('T')
returns '+07', which is rather confusing for the users of a scheduling system I'm building.
I would expect T
to always return a 'non-numeric' indication of the timezone, is there a way to achieve this without having to resort to writing out 'Asia/Bangkok'?
It should return "ICT". It's a known bug of PHP: https://bugs.php.net/bug.php?id=74835
You get the same result without Carbon:
$date = new DateTime('now', new DateTimeZone('Asia/Bangkok'));
echo $date->format('T');