计算俩个时间的相隔分钟数
作者:互联网
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long currentTime =System.currentTimeMillis();
//从对象中拿到时间
long createTime = df.parse("2021-02-19 17:50:50").getTime();
long diff=(currentTime-createTime)/1000/60;
System.out.println("当前系统时间为:"+currentTime+"下单时间为:"+createTime+"两个时间差为:"+diff);
标签:currentTime,System,long,分钟,俩个,diff,SimpleDateFormat,createTime,相隔 来源: https://blog.csdn.net/qq_44784918/article/details/113869285