java 8 get epoch milliseconds code example Example: get epoch time in java long epochTime=System.currentTimeMillis();