get current unix timestamp java

Java
System.currentTimeMillis() / 1000L;
Source

Also in Java: