java.time.ZoneOffset.adjustInto() 方法示例


java.time.ZoneOffset.adjustInto() 方法示例

package com.codingdict;

import java.time.ZoneOffset;
import java.time.ZonedDateTime;

public class ZoneOffsetDemo {
   public static void main(String[] args) {

      ZonedDateTime date = ZonedDateTime.now();
      System.out.println(date);  

      ZoneOffset zoneOffset = ZoneOffset.of("Z");

      date = (ZonedDateTime)zoneOffset.adjustInto(date);
      System.out.println(date);  
   }
}