Need to know how can I simply use the date
function with a reserved word?
See this code:
echo date("Y-m-dTH:i:s"); // "2012-08-24EST12:35:46" -> It's wrong.
echo date("Y-m-d")."T".date("H:i:s"); // It's correct, But Not my style.
I want to get this string 2012-08-23T14:01:02
, but When I use T
in the FORMAT
string. The result is not what I want. (Because T
is reserve word)
How to use T
string with date
function?
You could escape them with \
.
echo date('Y-m-d\TH:i:s');