날짜 계산하기 정보
JavaScript 날짜 계산하기본문
타입이 date, datetime인 컬럼 nnn이 있다고 하면
날짜만 넣기
update tbl set nnn=curdate() where idx=124;
시각까지 넣기
update tbl set nnn=now() where idx=124;
nnn에 3일 더하기
update tbl set nnn = nnn + interval 3 day where idx=124;
날짜 타입 mmm이 더 있다고 하고
select to_days( nnn)- to_days(mmm) from tbl
두 날짜 값의 차이를 날 수로 계산
4.1이후에는 DATEDIFF() 전용 함수가 있습니다.<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:27:00 MySQL에서 이동 됨]</div>
날짜만 넣기
update tbl set nnn=curdate() where idx=124;
시각까지 넣기
update tbl set nnn=now() where idx=124;
nnn에 3일 더하기
update tbl set nnn = nnn + interval 3 day where idx=124;
날짜 타입 mmm이 더 있다고 하고
select to_days( nnn)- to_days(mmm) from tbl
두 날짜 값의 차이를 날 수로 계산
4.1이후에는 DATEDIFF() 전용 함수가 있습니다.<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:27:00 MySQL에서 이동 됨]</div>
추천
0
0
댓글 1개

좋은팁이네요^^
감사합니다.
감사합니다.