fork download
  1. import java.time.*;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. ZoneId tz = ZoneId.of("Europe/London");
  6. Instant instant = LocalDate.now(tz)
  7. .atStartOfDay(tz)
  8. .toInstant();
  9.  
  10. long epochMillis = instant.toEpochMilli();
  11. long epochSeconds = instant.getEpochSecond();
  12. System.out.println(epochMillis);
  13. System.out.println(epochSeconds);
  14. }
  15. }
Success #stdin #stdout 0.16s 59136KB
stdin
Standard input is empty
stdout
1708646400000
1708646400