-
the SELECT CURDATE (); - get the current date
-
the SELECT LAST_DAY ( CURDATE ()); - obtaining the last day of the month.
-
SELECT DATE_ADD ( CURDATE (), interval The - Day ( CURDATE ()) + . 1 Day ); - obtaining a first day of the month
-
SELECT DATE_ADD ( CURDATE () - Day ( CURDATE ()) + . 1 , interval The . 1 month The ); - obtaining a first day of the next month
-
SELECT the DATEDIFF ( DATE_ADD ( CURDATE () - Day ( CURDATE ()) + . 1 , interval The . 1 month The ), DATE_ADD ( CURDATE (), interval The - Day ( CURDATE ()) + . 1 Day )) from Dual ; - Get current month number of days
MySQL obtain first day of the month, the first day of the next month, etc.
Guess you like
Origin www.cnblogs.com/lixiaozhi/p/11535160.html
Recommended
Ranking