문제

I have a TIMESTAMP in the database for pages, so in this format $d="2011-01-03 12:53:22"

And when i try to send that through date("c",$d) I only get 1970-01-01T10:33:31+10:00

I have read in the php manual that date("c",THIS) must be an INT so what do i use to get the int from "2011-01-03 12:53:22"??

도움이 되었습니까?

해결책

you forget to convert the date string to timestamp when sending for date function

date('c', strtotime($d));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top