mysql 월 시작 일 , 월 끝 일 가져오기
SELECT now(),CAST(DATE_FORMAT(NOW() ,’%Y-%m-01’) as DATE),LAST_DAY(now());
now() CAST(DATE_FORMAT(NOW() ,’%Y-%m-01’) as DATE) LAST_DAY(now()) 2016-09-07 14:43:49 2016-09-01 2016-09-30
LAST_DAY() 라는 함수 자주 써주자.
SELECT now(),CAST(DATE_FORMAT(NOW() ,’%Y-%m-01’) as DATE),LAST_DAY(now());
now() CAST(DATE_FORMAT(NOW() ,’%Y-%m-01’) as DATE) LAST_DAY(now()) 2016-09-07 14:43:49 2016-09-01 2016-09-30
LAST_DAY() 라는 함수 자주 써주자.