具体代码如下,更好的方案一起探讨:1
2
3
4
5
6public class DateFormateUtil {
private static final DateTimeFormatter BATCH_NO_FORMAT = DateTimeFormatter.ofPattern("yyyyMMddHHmm");
public static long getBatchNo(){
return Long.parseLong(BATCH_NO_FORMAT.format(LocalDateTime.now()));
}
}