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



描述

java.time.ZonedDateTime.getMinute() 方法獲取時分欄位。

宣告

以下是 java.time.ZonedDateTime.getMinute() 方法的宣告。

public int getMinute()

返回值

時分,從 0 到 59。

示例

以下示例展示了 java.time.ZonedDateTime.getMinute() 方法的使用。

package com.tutorialspoint;

import java.time.ZonedDateTime;

public class ZonedDateTimeDemo {
   public static void main(String[] args) {
 
      ZonedDateTime date = ZonedDateTime.parse("2017-03-28T12:25:38.492+05:30[Asia/Calcutta]");
      System.out.println(date.getMinute());  
   }
}

讓我們編譯並執行上面的程式,這將產生以下結果 −

25
廣告