dateformat mysql

u awal bulan sekarang >> date_format(now() , ‘%Y-%m-01′)

u tgl akhir bulan sekarang >> DATE_FORMAT(LAST_DAY(now()),’%Y-%m-%d’)

u awal tahun skrg >> date_format(NOW() , ‘%Y-01-01′)

1bulan sebelum >> last_day(NOW() – INTERVAL 1 MONTH)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s