Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.TimeZone; public class Main { public static Long generateTimeStamp() { Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); return calendar.getTimeInMillis() / 1000L; } }