博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
java clock计时_Java Clock类| systemUTC()方法与示例
阅读量:2530 次
发布时间:2019-05-11

本文共 1740 字,大约阅读时间需要 5 分钟。

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区域中实现适当系统时钟的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()方法是静态方法,可以使用类名进行访问,如果尝试使用类对象访问该方法,则不会出错。

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

    在表示Clock时, systemUTC()方法不会引发异常。

Syntax:

句法:

public static Clock systemUTC();

Parameter(s):

参数:

  • 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区域中相关系统时钟的当前时刻。

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-zone Clock 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]

翻译自:

java clock计时

转载地址:http://potzd.baihongyu.com/

你可能感兴趣的文章
linux awk命令详解
查看>>
OO第一次总结博客
查看>>
day7
查看>>
iphone移动端踩坑
查看>>
vs无法加载项目
查看>>
Beanutils基本用法
查看>>
玉伯的一道课后题题解(关于 IEEE 754 双精度浮点型精度损失)
查看>>
《BI那点儿事》数据流转换——百分比抽样、行抽样
查看>>
哈希(1) hash的基本知识回顾
查看>>
Leetcode 6——ZigZag Conversion
查看>>
dockerfile_nginx+PHP+mongo数据库_完美搭建
查看>>
Http协议的学习
查看>>
【转】轻松记住大端小端的含义(附对大端和小端的解释)
查看>>
设计模式那点事读书笔记(3)----建造者模式
查看>>
交换机划分Vlan配置
查看>>
yum安装Elasticsearch5.x
查看>>
正则表达式
查看>>
Python模块_json & pickle模块
查看>>
Python 模块之_os模块_os是与操作系统交互的接口
查看>>
通通玩blend美工(1)——荧光Button
查看>>