Getting “unixtime” in Java Avoid the Date object creation w/ System.currentTimeMillis(). A divide by 1000 gets you to Unix epoch. As mentioned in a comment, you typically want a primitive long (lower-case-l long)... April 3, 2022 0 Comments