날짜7 PHP time() function calcElapsedTime($time) { // calculate elapsed time (in seconds!) $diff = time()-$time; $daysDiff = floor($diff/60/60/24); $diff -= $daysDiff*60*60*24; $hrsDiff = floor($diff/60/60); $diff -= $hrsDiff*60*60; $minsDiff = floor($diff/60); $diff -= $minsDiff*60; $secsDiff = $diff; return ('(elapsed time '.$daysDiff.'d '.$hrsDiff.'h '.$minsDiff.'m '.$secsDiff.'s)'); } 2008. 10. 14. MYSQL 7일 기간 텀으로 쿼리 부르기 SELECT count(*) as num FROM table WHERE UNIX_FROM(signdate, '%Y-%m-%d') 2008. 10. 10. MYSQL 날짜와 시간별 데이타 뽑아내기 SELECT ex_no, from_unixtime(`reg_date`,'%Y%m%d%H') as hh, COUNT(ex_no) AS `cnt_reg_date` FROM expose_log Where from_unixtime(reg_date,'%Y%m%d%H') >= '04050406' AND from_unixtime(reg_date,'%Y%m%d%H') 2008. 10. 9. 이전 1 2 다음