Here you can find the source of now()
private static long now()
//package com.java2s; //License from project: Apache License import java.util.Date; import java.util.concurrent.TimeUnit; public class Main { private static long now() { Date date = new Date(); long b = TimeUnit.MILLISECONDS.toSeconds(date.getTime()); return b; }/* ww w . j a v a 2 s .co m*/ }