Android examples for java.util:Date Time
Gets the current timestamp in the iOS system.
import java.util.Calendar; public class Main{ /** The reference date of the iOS system. */ public static final long NS_DATE_REFERENCE_SEC = 978307200; /**// w w w . j ava 2 s . c o m * Gets the current timestamp in the iOS system. */ public static long getCurrentNSTimestamp() { Calendar c = Calendar.getInstance(); c.add(Calendar.DATE, 1); long time = c.getTime().getTime(); return (time - (NS_DATE_REFERENCE_SEC * 1000)) / 1000; } }