fork download
  1. import java.time.ZoneId;
  2. import java.time.ZonedDateTime;
  3. import java.time.format.DateTimeFormatter;
  4. import java.util.Locale;
  5.  
  6. public class Main {
  7. public static void main(String[] args) {
  8. ZonedDateTime now = ZonedDateTime.now(ZoneId.of("America/New_York"));
  9. DateTimeFormatter dtf = DateTimeFormatter.ofPattern("MMM dd, yyyy HH:mm:ss zzz", Locale.ENGLISH);
  10. System.out.println(now.format(dtf));
  11. }
  12. }
Success #stdin #stdout 0.21s 59376KB
stdin
Standard input is empty
stdout
Nov 25, 2024 10:53:56 EST