java.time
I cannot tell you whether it alleviates your problem. In you insist on having the year 2038 problem, this how I would prefer to write the method:
public static int getUnixTimeStamp() {
Instant now = Instant.now();
return Math.toIntExact(now.getEpochSecond());
}
The method just returned 1 614 441 874. I am using java.time, the modern Java date and time API, which is rock solid, so I should say that you have a chance. Other advantages of the code are (1) there is no conversion from milliseconds to seconds (2) in 2038 the code will stop working rather than start giving surprising incorrect results.
Link: Year 2038 problem