java怎么获取19位时间戳

Python013

java怎么获取19位时间戳,第1张

public Long getToday(){

DateTime now = new DateTime()

return new DateTime(now.getYear(), now.getMonthOfYear(), now.getDayOfMonth(), 0, 0, 0, 0).getMillis()

}

public Long getTomorrow(){

DateTime now = new DateTime()

return new DateTime(now.getYear(), now.getMonthOfYear(), now.getDayOfMonth(), 0, 0, 0, 0).plusDays(1).getMillis()

}

应该用System.out.format函数,可以给你实例

System.out.format(java.util.Locale.US, "%1$ta, %1$td %1$tb %1$tY %1$tT %1$tz", new java.util.Date())

不仅给你实例,还给你参考文献

http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html

最后,采纳即可