java获取当前时间(精确到微秒)
如果需要获取精确到微秒的时间可以使用下面方法:public static StringgetNowTime(){LocalDateTime localDateTime=LocalDateTime.now();return localDateTime.getYear()+"-"+localDateTime.getMonthValue()+"-"+localDateTime.getDayOfMonth
·
如果需要获取精确到微秒的时间可以使用下面方法:
public static String getNowTime(){
LocalDateTime localDateTime=LocalDateTime.now();
return localDateTime.getYear()+"-"+localDateTime.getMonthValue()+"-"+localDateTime.getDayOfMonth()+
" "+localDateTime.getHour()+":"+localDateTime.getMinute()+":"+localDateTime.getSecond()+"."+
localDateTime.getNano()/1000;
}
更多推荐
所有评论(0)