get Next Date For Day using starting milliseconds - Android java.util

Android examples for java.util:Date

Description

get Next Date For Day using starting milliseconds

Demo Code


//package com.java2s;

public class Main {

    private static final long DAY_MILLS = 1000 * 60 * 60 * 24;

    public static long getNextDateForDay(long startMills) {
        long currentMills = System.currentTimeMillis();
        long nextMills = startMills;
        while (currentMills > nextMills) {
            nextMills += DAY_MILLS;/*from w w w  . jav a 2  s  .  c om*/
        }
        return nextMills;
    }
}

Related Tutorials