I have this code
$daytime=date("D M j G:i:s T Y");
anyone can explain me why in some server the value T returns something like this
Tue Oct 10 12:30:50 -03 2017
while in another server the value T returns something like this
Tue Oct 10 12:30:50 CDT 2017
How can I do to always display the CDT value instead of the numeric value -03 ?
Thank you
Dump the result of date_default_timezone_get() on both servers and see the difference. It depends which timezone identifier your server is set to. Some timezone identifiers will display as +xx or -xx when using the T modifier, while identifiers will be abbreviated.
If you want to force a specific timezone in your application without changing server configuration, you can set it using date_default_timezone_set().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With