public static long getCurrentTimeUtc ( ) { Instant instant = Instant . now ( ) ; ZonedDateTime dateTime = instant . atZone ( ZoneOffset . UTC ) ; return dateTime . toInstant ( ) . toEpochMilli ( ) ; }
Get the current time in utc in milliseconds