fork download
  1. import java.time.ZoneId;
  2. import java.time.ZonedDateTime;
  3.  
  4. class Main {
  5. public static void main(String[] args) {
  6. // Change the time zone ID as per your requirement
  7. ZoneId zoneId = ZoneId.of("Europe/London");
  8. int dayOfMonth = ZonedDateTime.now(zoneId).getDayOfMonth();
  9. System.out.println(dayOfMonth);
  10. }
  11. }
Success #stdin #stdout 0.12s 57280KB
stdin
Standard input is empty
stdout
12