且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将mysql时间戳转换为实际的日期和时间?

更新时间:2023-02-03 15:23:10

  echo date('M j Y g:i A',strtotime('2010-05-29 01:17:35')); 

http://php.net/manual/en/function.date.php


I have dates stored in a mysql table, they are set to store as CURRENT TIMESTAMP in each row and are stored as follows:

2010-05-29 01:17:35

but what i am trying to do is somehow use PHP to be able to seperate everything and create a date more like:

May 29 2010 1:17 AM

can anyone at least direct me in the right path that i should take. any help is greatly appreciated!

echo date('M j Y g:i A', strtotime('2010-05-29 01:17:35'));

http://php.net/manual/en/function.date.php