java.time.ZonedDateTime.format() 方法示例


java.time.ZonedDateTime.format() 方法示例

package com.codingdict;

import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

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

      ZonedDateTime date = ZonedDateTime.parse("2017-03-28T12:13:20.408+05:30[Asia/Calcutta]");
      System.out.println(date);  
      DateTimeFormatter formatter = DateTimeFormatter.ISO_TIME;
      System.out.println(formatter.format(date));  
   }
}