Reputation: 2891
I want to use DATETIME_FORMAT = 'Y-n-jTH:i:s'
to display 2014-4-26T16:19:43
, But the result is 2014-4-26CST16:19:43
, How to Escape T
(which is for timezone)? docs
Upvotes: 3
Views: 1161
Reputation: 2891
'Y-n-j\TH:i:s'
works. See echo date('l jS \of F Y h:i:s A');
on this reference.
Upvotes: 5
Reputation: 599926
You should just use the c
value on its own, which matches the standard ISO format - which is what your desired format is.
Upvotes: 0
Reputation: 11253
Standard datetime formatting requires preformatted characters to be surrounded in quotes. Try this:
DATETIME_FORMAT = "Y-n-j'T'H:i:s"
Upvotes: 0