Date date=new Date(); long hm=date.getTime(); //获取毫秒 或者 毫秒级:System.currentTimeMillis() 纳秒级: System.nanoTime() 用 System.nanoTime() public static long nanoTime() 返回最准确的可用系统计时器的当前值,以毫微秒为单位. 此方法只能用于测量已过的时间,与系统或钟表时间的其他任何时间概念无关.返回值表示从某一固定但任意的时间算起的毫微秒数(或许从以
SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss"); String dateString = "2014/10/11 14:50:11"; Date date = df.parse(dateString); long s=date.getTime(); System.out.println(s/1
毫秒 /** * Returns the time represented by this Timestamp object, as a long value * containing the number of milliseconds since the Epoch (January 1 1970, * 00:00:00.000 GMT) */ @Override public long getTime() { long theTime = super.getTime(); theTime