MySQL 获取日期中的年月日
获取当前系统时间并从中依次取出对应的年月日和时间和周
select year(now()) as year;
select month(now()) as month;
select day(now()) as day;
select time(now()) as time;
SELECT YEARWEEK(now()); --获取当前周
SELECT QUARTER('2022-12-01'); --获取当前季度
获取当前系统时间并从中依次取出对应的年月日和时间和周
select year(now()) as year;
select month(now()) as month;
select day(now()) as day;
select time(now()) as time;
SELECT YEARWEEK(now()); --获取当前周
SELECT QUARTER('2022-12-01'); --获取当前季度