| | |
| | | import java.text.DateFormatSymbols; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.Duration; |
| | | import java.util.Date; |
| | | import java.util.*; |
| | | |
| | |
| | | nowDate = sdfShort.format(date); |
| | | return nowDate; |
| | | } catch (Exception e) { |
| | | throw e; |
| | | return null; |
| | | } |
| | | } |
| | | |
| | |
| | | * @param end |
| | | * @return |
| | | */ |
| | | public static long betweenMin(Date begin, Date end) { |
| | | public static Integer betweenMin(Date begin, Date end) { |
| | | if(begin ==null ){ |
| | | return 0; |
| | | } |
| | | long createTime =begin.getTime();//获取创建时间的时间戳 |
| | | long currentTime =Objects.isNull(end)?System.currentTimeMillis():end.getTime();//获取当前时间的时间戳 |
| | | long diff=(currentTime-createTime)/1000/60;//获取两个时间相差的分钟 |
| | | return diff; |
| | | return (int)diff; |
| | | } |
| | | |
| | | |
| | |
| | | return consuming.toString(); |
| | | } |
| | | |
| | | } |
| | | } |