I have a unix timestapm in my database and i want it to be formated like this:
Y-m-dTH:i:s
T is just a symbol between date and time. If I convert it like this:
$t_date=date("Y-m-dTH:i:s", $row['date']);
I get something like this: 2012-03-05UTC06:06:49. The problem is that T is one of the parameters for formating date.
<?php
echo $t_date=date("Y-m-d\TH:i:s", time());
?>
see http://codepad.org/SOSmzKvS
If you're using PHP 5+, you can just use date("c")
to get an ISO8601-format date (e.g. 2004-02-12T15:19:21+00:00
).
http://us.php.net/manual/en/function.date.php
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