get first and last date in a month with php, mysql

mySql:

 SELECT DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 0 MONTH), '%Y-%m-01');  
 SELECT LAST_DAY(DATE_ADD(CURDATE(), INTERVAL 0 MONTH));  

php :
 $first = date('Y-m-d', mktime(0, 0, 0, date('m'), 1, date('Y')));  
 $last = date('Y-m-t', mktime(0, 0, 0, date('m'), 1, date('Y')));  

Comments

Popular posts from this blog

Data Flow Diagram (DFD)

VERIFIKASI SUARA MENGGUNAKAN METODE MFCC DAN DTW MENGGUNAKAN METODE MFCC DAN DTW (BAB II TINJAUAN PUSTAKA)

flexigrid + php with add and edit button