Here you can find the source of getCurrentTimestampInSeconds()
public static long getCurrentTimestampInSeconds()
//package com.java2s; /*/*from w ww .j a va 2s . c om*/ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ import java.util.concurrent.TimeUnit; public class Main { /** * Get current time in seconds. See also {@link System#currentTimeMillis()}. * * @return the difference, measured in seconds, between the current time and midnight, January 1, 1970 UTC. */ public static long getCurrentTimestampInSeconds() { return TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()); } }