Here you can find the source of currentTimeSecond()
public static long currentTimeSecond()
//package com.java2s; public class Main { /** One second: 1000 milliseconds. */ public static final long SECOND = 1000l; /**//from w w w .j a v a 2 s . co m * Gets the current time, rounded down to the closest second. * Equivalent to invoking * {@code roundToSecond(System.currentTimeMillis())}. * * @return the current time, rounded to the closest second. */ public static long currentTimeSecond() { return roundToSecond(System.currentTimeMillis()); } /** * Rounds the given time down to the closest second. * * @param pTime time * @return the time rounded to the closest second. */ public static long roundToSecond(final long pTime) { return (pTime / SECOND) * SECOND; } }