日期格式转换(3):2021-03-31 00:00 => 1617120000000

method 1:
+new Date("2021-03-31 00:00")
method 2:
new Date('2021-03-31 00:00').getTime()
method 3:
new Date('2021-03-31 00:00').valueOf()

你可能感兴趣的:(编程,javascript,时间格式化)