2009/02/27 14:29

[mysql]long value to date Others

#select from_unixtime(left(1235710486328, 10));

long type의 마지막 3자리는 milisec.
뒤에서 세자리 빼고 앞에 숫자만 값을 변경하기 위하여 앞에 숫자리 길이만큼만 값을 취함.

그러면 결과는,
"2009-02-27 13:54:46"


select id, 
       userid, 
      
from_unixtime(left(last_update, length(last_update)-3)) as last_update,
       status
  from table_name
;


트랙백

이 글과 관련된 글 쓰기 (트랙백 보내기)
TrackbackURL : http://ilovejava.egloos.com/tb/2284552 [도움말]

덧글

덧글 입력 영역

라이프로그