Java examples for java.util:Millisecond
round Millis To Date
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { double aMillis = 2.45678; System.out.println(roundMillisToDate(aMillis)); }/* www. j a v a 2 s . co m*/ public static final int MILLIS_IN_DAY = 86400000; public static long roundMillisToDate(double aMillis) { Double dateInMillis = Math.floor(aMillis / 86400000) * MILLIS_IN_DAY; return dateInMillis.longValue(); } }