Here you can find the source of currentSeconds()
public static long currentSeconds()
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static long currentSeconds() { Calendar c = Calendar.getInstance(); long mseconds = c.getTimeInMillis(); return mseconds / 1000; }/*from w w w. j a va 2 s.c om*/ }