Skip to content

Instantly share code, notes, and snippets.

@L-Soft
Last active April 13, 2020 10:26
Show Gist options
  • Save L-Soft/250eb2eb6f78a63f530ca8d87559df05 to your computer and use it in GitHub Desktop.
Save L-Soft/250eb2eb6f78a63f530ca8d87559df05 to your computer and use it in GitHub Desktop.
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
public class CodeTest {
public static void main(String[] args) {
// https://currentmillis.com
// https://perfectacle.github.io/2018/09/26/java8-date-time/
OffsetDateTime offsetDateTime = OffsetDateTime.of(2019, 12, 2, 0, 0, 0, 0, ZoneOffset.UTC);
System.out.println(offsetDateTime.toInstant().toEpochMilli());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment