You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
695 B
20 lines
695 B
package demo.tool;
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import java.util.Date;
|
|
|
|
public class ToolTests {
|
|
public static void main(String[] args) {
|
|
// long t = 1665973324L*1000;
|
|
long t = Long.parseLong("1665973324000");
|
|
System.out.println(System.currentTimeMillis()); //from_unixtime select from_unixtime(1252999488);
|
|
// Date d = new Date(1252999488000L);
|
|
Date d = new Date(t);
|
|
System.out.println(DateUtil.format(d, "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
DateTime parse = DateUtil.parse("2010-01-01 00:00:00");
|
|
System.out.println("2010-01-01 00:00:00 === " + parse.getTime()); //1262275200000
|
|
}
|
|
}
|
|
|