Many of us do not realize that MySQL’s Timestamp is not the timestamp which PHP date() understands. 많은 이용하지 않습니다 mysql의 타임 스탬프는 사실을 깨닫지의 타임 스탬프를 php 날짜 ()을 이해합니다. In fact if you try to use MySQL timestamp directly in php date() function then you will get totally wrong dates. 실제로 mysql을 사용하려고하는 경우 타임 스탬프를 직접 php 날짜 () 함수는 그렇다면 완전히 잘못된 날짜 얻을 것이다. There is a simple way to use MySQL timestamp data in php. 타임 스탬프를 사용하는 간단한 방법이 데이터를 mysql php합니다.

First you need to modify the SQL query to use MySQL’s UNIX_TIMESTAMP() function. sql 쿼리를 수정하는 첫 번째를 사용해야합니다 mysql의 unix_timestamp () 함수를합니다. So if your SQL looks like: 만약 귀하의 sql는 이렇게 보입니다 :
SELECT author, `when` … 저자를 선택,`…`

then convert it to: 다음으로 변환합니다 :
SELECT author, UNIX_TIMESTAMP(`when`) … 선택한 저자, unix_timestamp (``)…

Then use PHP’s date() function to convert the unix timestamp to appropriate display format like this: 을 사용 php의 날짜 () 함수는 유닉스 타임 스탬프를 적절한 표시 형식으로 변환합니다 이렇게 :
date(”F j, Y, g:i a”, $row[1]) 날짜 ( "이름 일본, 그리고, g : 나는", $ 행 [1])

where $row[1] contains the timestamp column value. 어디 $ 행 [1]의 타임 스탬프 열의 값을 포함합니다.