select unix_timestamp(‘2018-12’,‘yyyy’);
1514736000
select from_unixtime(1514736000);
2018-01-01 00:00:00
select unix_timestamp(‘2018-12’,‘yyyy-MM’);
1543593600
select from_unixtime(1543593600);
2018-12-01 00:00:00
select from_unixtime(1543593600,‘yyyy’);
2018
select from_unixtime(unix_timestamp’2018-12’,‘yyyy-MM’),‘yyyy/MM/dd’);
2018/12/01
https://www.cnblogs.com/allthewayforward/p/11165302.html