Here you can find the source of getSeconds()
public static int getSeconds()
//package com.java2s; //License from project: Apache License public class Main { public static int getSeconds() { int seconds = (int) (System.currentTimeMillis() / 1000L); return seconds; }// www . ja v a 2s . c om }