日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

java clock计时_Java Clock类| systemUTC()方法与示例

發(fā)布時間:2025/3/11 54 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java clock计时_Java Clock类| systemUTC()方法与示例 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

java clock計時

Clock Class systemUTC()方法 (Clock Class systemUTC() method)

  • systemUTC() method is available in java.time package.

    systemUTC()方法在java.time包中可用。

  • systemUTC() method is used to get a Clock that implements the suitable system clock in the UTC zone.

    systemUTC()方法用于獲取在UTC區(qū)域中實現(xiàn)適當系統(tǒng)時鐘的Clock。

  • systemUTC() method is a static method, it is accessible with the class name and if we try to access the method with the class object then we will not get an error.

    systemUTC()方法是靜態(tài)方法,可以使用類名進行訪問,如果嘗試使用類對象訪問該方法,則不會出錯。

  • systemUTC() method does not throw an exception at the time of representing Clock.

    在表示Clock時, systemUTC()方法不會引發(fā)異常。

Syntax:

句法:

public static Clock systemUTC();

Parameter(s):

參數(shù):

  • None

    沒有

Return value:

返回值:

The return type of this method is Clock, it returns the present instant that use the relevant system clock in the UTC zone.

該方法的返回類型為Clock ,它返回使用UTC區(qū)域中相關(guān)系統(tǒng)時鐘的當前時刻。

Example:

例:

// Java program to demonstrate the example // of systemUTC() method of Clockimport java.time.*;public class SystemUTCOfClock {public static void main(String args[]) {// Instantiates a ZoneId for Accra ZoneId zone_1 = ZoneId.of("Africa/Accra");// Instantiates a clock for// the given zone_1 Clock cl1 = Clock.system(zone_1);// returns a Clock that returns the current// instant with help of using the system clock // in the UTC time-zoneClock sys_utc_zone = cl1.systemUTC();System.out.println("cl1.systemUTC(): " + sys_utc_zone.toString());sys_utc_zone = Clock.systemUTC();System.out.println("Clock.systemUTC(): " + sys_utc_zone.toString());} }

Output

輸出量

cl1.systemUTC(): SystemClock[Z] Clock.systemUTC(): SystemClock[Z]

翻譯自: https://www.includehelp.com/java/clock-systemutc-method-with-example.aspx

java clock計時

總結(jié)

以上是生活随笔為你收集整理的java clock计时_Java Clock类| systemUTC()方法与示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。