Select date_sub (now (), interval 1 month) current time of last month today select unix_timestamp (date_sub (now (), interval 1 month) current time of last month today (timestamp) select date_sub (date_format (now (), '% Y-% m-% d 08:00:00'), interval extract (day fromnow ()-1 day ), interval 1 month) Select unix_timestamp (date_sub (date_format (now (), '% Y-% m-% d 08:00:00') on the first day of the last month '), intervalextract (day from now ()-1 day), interval 1 month) First day of last month (timestamp) First day of last month: Select date_sub (date_format (now (), '% Y-% m-% D'), interval extract (day from now ()-1 day), interval 1 month) the last day of the last month: select date_sub (date_format (now (), '% Y-% m-% D'), interval extract (day from now () Day), interval 0 month) as date: the first day of the month: Select date_sub (date_format (now (), '% Y-% m-% D'), interval extract (day from now ()) -1 day), interval 0 month) the last day of the month: Select date_sub (date_format (now (), '% Y-% m-% D '), interval extract (day from now () Day), interval-1 month) as date