Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

zoneddatetime java

        ZonedDateTime zonedatetime = ZonedDateTime.of(LocalDate.now(), LocalTime.now(), ZoneId.systemDefault());

        System.out.println("Current Zone Date/Time: " + zonedatetime);
        System.out.println("Current Zone : " + zonedatetime.getZone());
        System.out.println("Zone Date/Time 10 days ago: " + zonedatetime.minus(Period.ofDays(10)));
        
        // See https://docs.oracle.com/javase/8/docs/api/java/time/ZonedDateTime.html for more information 
 
PREVIOUS NEXT
Tagged: #zoneddatetime #java
ADD COMMENT
Topic
Name
4+9 =