Java Number Round roundToDay(long time)

Here you can find the source of roundToDay(long time)

Description

Rounds the time to an exact day.

License

Open Source License

Declaration

public static long roundToDay(long time) 

Method Source Code

//package com.java2s;
/*//from ww w. j av a2 s .c  o  m
 * aocode-public - Reusable Java library of general tools with minimal external dependencies.
 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013, 2016, 2018  AO Industries, Inc.
 *     support@aoindustries.com
 *     7262 Bull Pen Cir
 *     Mobile, AL 36695
 *
 * This file is part of aocode-public.
 *
 * aocode-public is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * aocode-public is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with aocode-public.  If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    /**
     * Rounds the time to an exact day.
     */
    public static long roundToDay(long time) {
        return time / (24 * 60 * 60) * (24 * 60 * 60);
    }
}

Related

  1. roundTo3Places(double n)
  2. roundTo6decimals(Double x)
  3. roundToAccuracy(float n, float i)
  4. roundToBase(int a, int base)
  5. roundToBytes(int bitWidth)
  6. roundToDecentPrecision(double value)
  7. roundToDecimalPlaces(final double val, final int places)
  8. roundToDecimals(double d, int c)
  9. roundToDecimals(double d, int c)