Format date in MySQL SELECT as ISO 8601

前端 未结 7 2130
攒了一身酷
攒了一身酷 2020-12-05 17:14

I\'m trying to grab the date from my database in a standard timestamp and display it as ISO 8601. I\'m unable to easily do it in PHP so I\'m trying to do it in my SELECT st

7条回答
  •  忘掉有多难
    2020-12-05 17:25

    Loading the date field from the database and converting it to ISO format with PHP is straight-forward; see the c format string to PHP date: http://www.php.net/manual/en/function.date.php

    echo date('c'); // expected "2013-03-08T14:45:37+05:00"
    

提交回复
热议问题