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

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

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

java clock计时

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/541471.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

《Android 应用测试指南》——第2章,第2.4节包浏览器

本节书摘来自异步社区《Android 应用测试指南》一书中的第2章,第2.4节包浏览器,作者 【阿根廷】Diego Torres Milano(迭戈 D.),更多章节内容可以访问云栖社区“异步社区”公众号查看 2.4 包浏览器创建完前面提到的两个…

操作系统系统调用_操作系统中的系统调用

操作系统系统调用系统调用简介 (Introduction to System calls) The interface between the operating system and the user program is defined by the set of extended instruction that the operating system provides. These extended instructions are known as system ca…

java分数表示_表示Java分数的最佳方法?

小编典典碰巧的是不久前我写了一个BigFraction类,用于解决Euler项目问题。它保留了BigInteger分子和分母,因此它将永远不会溢出。但是,对于许多你永远不会溢出的操作来说,这会有点慢。无论如何,请根据需要使用它。我一…

《OpenStack云计算实战手册(第2版)》——1.7 添加用户

本节书摘来自异步社区《OpenStack云计算实战手册(第2版)》一书中的第1章,第1.7节,作者: 【英】Kevin Jackson , 【美】Cody Bunch 更多章节内容可以访问云栖社区“异步社区”公众号查看。 1.7 添加用户 在OpenStack身份认证服务中…

开源软件和自由软件_自由和开源软件的经济学

开源软件和自由软件零边际成本 (Zero Marginal Cost) At the core of the financial aspects of Free and Open Source is the zero negligible expense of merchandise in an environment that is digital. Right now, the rise of Free and Open Source speaks to an affirma…

java外部类_Java里什么叫内部类什么叫外部类

展开全部对普通类(没有内部类的类)来说,62616964757a686964616fe78988e69d8331333337396234内部类和外部类都与他无关;对有内部类的类来说,它们就是其内部类的外部类,外部类是个相对的说法,其实就是有内部类的类。所以…

《精通Matlab数字图像处理与识别》一6.2 傅立叶变换基础知识

本节书摘来自异步社区《精通Matlab数字图像处理与识别》一书中的第6章,第6.2节,作者 张铮 , 倪红霞 , 苑春苗 , 杨立红,更多章节内容可以访问云栖社区“异步社区”公众号查看 6.2 傅立叶变换基础知识 精通Matlab数字图像处理与识别要理解傅立…

多线程循环输出abcc++_C ++循环| 查找输出程序| 套装5

多线程循环输出abccProgram 1: 程序1&#xff1a; #include <iostream>using namespace std;int main(){int num 15673;int R1 0, R2 0;do {R1 num % 10;R2 R2 * 10 R1;num num / 10;} while (num > 0);cout << R2 << " ";return 0;}Ou…

java oql_深入理解java虚拟机(八):java内存分析工具-MAT和OQL

以下内容翻译自MAT帮助文档。一、Class HistogramClass Histogram shows the classes found in the snapshot, the number of objects for each class, the heap memory consumption of these objects, and the minimum retained size of the objects二、Dominator treeDomina…

《Python数据分析与挖掘实战》一1.2 从餐饮服务到数据挖掘

本节书摘来自华章出版社《Python数据分析与挖掘实战》一书中的第1章&#xff0c;第1.2节&#xff0c;作者 张良均 王路 谭立云 苏剑林&#xff0c;更多章节内容可以访问云栖社区“华章计算机”公众号查看 1.2 从餐饮服务到数据挖掘 企业经营最大的目的就是盈利&#xff0c;而餐…

obj[]与obj._Ruby中带有示例的Array.include?(obj)方法

obj[]与obj.Ruby Array.include&#xff1f;(obj)方法 (Ruby Array.include?(obj) Method) In the previous articles, we have seen how we can check whether two Array instances are identical or not with the help of <> operator, operator, and .eql? method?…

java javah_Java开发网 - 一个javah的问题

Posted by:jerry_xuPosted on:2006-03-13 15:39我在环境变量中已经设置了path为D:\Program Files\Java\jdk1.5.0_06&#xff0c;ClassPath设置为.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;class的路径为&#xff1a;D:\JNItest\bin\jni\Hello.class &#xff0c;但是…

《Python面向对象编程指南》——2.7 __del__()方法

本节书摘来自异步社区《Python面向对象编程指南》一书中的第2章&#xff0c;第2.7节&#xff0c;作者&#xff3b;美&#xff3d;Steven F. Lott&#xff0c; 张心韬 兰亮 译&#xff0c;更多章节内容可以访问云栖社区“异步社区”公众号查看。 2.7 __del__()方法 __del__()方…

NullReferenceException C#中的异常

什么是NullReferenceException&#xff1f; (What is NullReferenceException?) NullReferenceException is an exception and it throws when the code is trying to access a reference that is not referencing to any object. If a reference variable/object is not refe…

java map key 大写转小写_Spring JdbcTemplate 查询出的Map,是如何产生大小写忽略的Key的?(转)...

Java 是区分大小写的&#xff0c;普通的Map例如HashMap如果其中的key"ABC" value"XXX"那么map.get("Abc") 或 map.get("abc")是获取不到值得。但Spring中产生了一个忽略大小写的map使我产生了好奇例如 jdbcTemplate.queryForList(sql)…

《iOS 6核心开发手册(第4版)》——2.11节秘诀:构建星星滑块

本节书摘来自异步社区《iOS 6核心开发手册&#xff08;第4版&#xff09;》一书中的第2章&#xff0c;第2.11节秘诀&#xff1a;构建星星滑块&#xff0c;作者 【美】Erica Sadun&#xff0c;更多章节内容可以访问云栖社区“异步社区”公众号查看 2.11 秘诀&#xff1a;构建星星…

css框架和js框架_优雅设计的顶级CSS框架

css框架和js框架Brief discussion: 简要讨论&#xff1a; Well, who doesnt want their website or web page to look attractive, stylish and be responsive? 那么&#xff0c;谁不希望自己的网站或网页看起来有吸引力&#xff0c;时尚并且ReactSwift&#xff1f; We put …

软考下午题具体解释---数据流图设计

在历年的软考下午题其中&#xff0c;有五道大题。各自是数据流图的设计&#xff0c;数据库设计&#xff0c;uml图&#xff0c;算法和设计模式&#xff0c;从今天这篇博文開始&#xff0c;小编就跟大家来一起学习软考下午题的相关内容。包含理论上的知识以及典型例题的解说&…

基本程序 打印Scala的Hello World

Scala中的基本程序 (Basic program in Scala) As your first Scala program, we will see a basic output program that just prints "Hello World" or any other similar type of string. With this example, we will see what are the part of the code that is im…

java treemap lastkey_Java TreeMap lastKey()用法及代码示例

java.util.TreeMap.lastKey()用于检索Map中存在的最后一个或最高键。用法:tree_map.lastKey()参数&#xff1a;该方法不带任何参数。返回值&#xff1a;该方法返回映射中存在的最后一个键。异常&#xff1a;如果映射为空&#xff0c;则该方法将引发NoSuchElementException。以下…