datetime 형을 UNIX_TIMESTAMP형으로 변환 후 시간계산 > PHP

본문 바로가기

사이트 내 전체검색

뒤로가기 PHP

datetime 형을 UNIX_TIMESTAMP형으로 변환 후 시간계산

페이지 정보

작성자 최고관리자 작성일 21-02-09 11:44 조회 5,877 댓글 0

본문

현재의 시간과 시간차 계산....

 <?
 #regdate = datetime type

 $SQL = "Select  UNIX_TIMESTAMP(regdate) as unix_time, UNIX_TIMESTAMP(now()) as now_time from tablename Where no = 584";
 $result = mysql_query($SQL);
 $row = mysql_fetch_row($result);
 $time = $row[0];

 $minus_h = (int)(($row[1] - $row[0])/3600);
 ?>

댓글목록 0

등록된 댓글이 없습니다.

Copyright © beautipia.co.kr. All rights reserved.

contact : webmaster@beautipia.co.kr

PC 버전으로 보기