gettimezone_Java日历getTimeZone()方法与示例

gettimezone

日历类的getTimeZone()方法 (Calendar Class getTimeZone() method)

  • getTimeZone() method is available in java.util package.

    getTimeZone()方法在java.util包中可用。

  • getTimeZone() method is used to return this Calendar time zone.

    getTimeZone()方法用于返回此Calendar时区。

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

    getTimeZone()方法是一种非静态方法,可通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。

  • getTimeZone() method does not throw an exception at the time of returning the current Calendar time zone.

    返回当前Calendar时区时, getTimeZone()方法不会引发异常。

Syntax:

句法:

    public TimeZone getTimeZone();

Parameter(s):

参数:

  • It does not accept any parameter.

    它不接受任何参数。

Return value:

返回值:

The return type of the method is TimeZone, it returns TimeZone of this Calendar.

方法的返回类型为TimeZone ,它返回此Calendar的TimeZone。

Example:

例:

// Java Program to demonstrate the example of
// TimeZone getTimeZone() method of Calendar
import java.util.*;
public class GetTimeZone {
public static void main(String args[]) {
// Instantiating a Calendar object
Calendar ca = Calendar.getInstance();
System.out.println("ca.getTime(): " + ca.getTime());
// By using getTimeZone() method is to
// return the time zone of this Calendar
TimeZone time_zone = ca.getTimeZone();
//Display time zone of this Calendar
System.out.println("ca.getTimeZone(): " + time_zone.getDisplayName());
}
}

Output

输出量

ca.getTime(): Mon Jan 27 08:15:04 GMT 2020
ca.getTimeZone(): Greenwich Mean Time

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

gettimezone

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

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

相关文章

cass展点不在原位置_cass展点之步骤及方法

cass展点之步骤及方法cass展点是根据手工或坐标正反算软件自动计算的结果,利用cass软件将点号、坐标及其高程自动展示到图纸上的一种方法。其基本步骤和方法如下:一、将井下测点的点号、以及计算好的Y坐标、X坐标、及高程由sheet1复制并粘贴到sheet2上面…

Java BufferedWriter close()方法与示例

BufferedWriter类close()方法 (BufferedWriter Class close() method) close() method is available in java.io package. close()方法在java.io包中可用。 close() method is used to flushes the characters from the stream and later will close it by using close() metho…

ISCC2014-reverse

这是我做reverse的题解。在咱逆向之路上的mark一下,,水平有限,大牛见笑。题目及题解链接:http://pan.baidu.com/s/1gd3k2RL 宗女齐姜 果然是仅仅有50分的难度,OD直接找到了flag. 找到杀手 这题用OD做非常麻烦。我改用I…

python 获取当前时间再往前几个月_Python 中的时间和日期操作

Python中,对日期和时间的操作,主要使用这3个内置模块: datetime 、 time 和 calendar 获取当前时间对应的数字 开发程序时,经常需要获取两个代码位置在执行时的时间差,比如,我们想知道某个函数执行大概耗费了多少时间,就可以使用time.time()来做。 import time before =…

Java BigDecimal restder()方法与示例

BigDecimal类的restder()方法 (BigDecimal Class remainder() method) Syntax: 句法: public BigDecimal remainder(BigDecimal divsr);public BigDecimal remainder(BigDecimal divsr, MathContext ma_co);remainder() method is available in java.math package.…

python程序需要编译么_python需要编译么

一个经常听见的问题,那就是:Python是解释型的语言吗?它会被编译吗?这个问题没有想象中那么好回答。和很多人认识世界一样,习惯以一个简单的模型去评判一些事物。而事实上,里面包含了很多很多的细节。通常的…

DevOps平台中的自动化部署框架设计

本文目录: 一、背景 二、我们的需求是什么? 三、概念澄清 四、概念模型 五、总体设计 六、关键点设计 七、总结 一、背景 说到自动化部署,大家肯定都会想到一些配置管理工具,像ansible,chef,puppet, saltstack等等。虽然这些工具给…

插入排序算法 ,递归实现_C程序实现递归插入排序

插入排序算法 ,递归实现The only difference between Insertion sort and Recursive Insertion Sort is that in the Recursive method, we start from placing the last element in its correct position in the sorted array instead of starting from the first. 插入排序和…

python虚拟机直接加载字节码运行程序_第二章 python如何运行程序

一.python解释器介绍Python解释器是一种让程序运行起来的程序。实际上,解释器是代码与机器的计算机硬件之间的软件逻辑层。当Python包安装在机器上后,它包含了一些最小化的组件:一个解释器和支持的库。二.python的视角当Python运行脚本时&…

Java LocalDate类| 带示例的format()方法

LocalDate类format()方法 (LocalDate Class format() method) format() method is available in java.time package. format()方法在java.time包中可用。 format() method is used to format this LocalDate object by using the given DateTimeFormatter object. format()方法…

胃癌2019csco指南_2019 CSCO胃癌诊疗指南精华来了!

一文轻松get 2019 CSCO胃癌诊疗指南更新要点!文丨青青子衿 中山大学肿瘤防治中心来源丨医学界肿瘤频道近日,2019年CSCO指南发布会于南京召开。今天为大家推送的是2019 CSCO胃癌诊疗指南的最新更新,在发布专场中,来自华中科技大学同…

001_docker-compose构建elk环境

由于打算给同事分享elk相关的东西,搭建配置elk环境太麻烦了,于是想到了docker。docker官方提供了docker-compose编排工具,elk集群一键就可以搞定,真是兴奋。好了下面咱们开始吧。 一、 https://github.com/deviantony/docker-elk $ cd /006_xxxallproject/005_docker/001_e…

Java即时类| toString()方法与示例

即时类toString()方法 (Instant Class toString() method) toString() method is available in java.time package. toString()方法在java.time包中可用。 toString() method is used to represent this Instant as a String by using the standards ISO-8601 format. toString…

learn opengl 中文_LearnOpenGL CN

欢迎来到OpenGL的世界欢迎来到OpenGL的世界。这个工程只是我(Joey de Vries)的一次小小的尝试,希望能够建立起一个完善的OpenGL教学平台。无论你学习OpenGL是为了学业,找工作,或仅仅是因为兴趣,这个网站都将能够教会你现代(Core-p…

MYSQL5.7 日志管理

2019独角兽企业重金招聘Python工程师标准>>> 慢查询日志slow-query-log1 slow-query-log-filefile_name long_query_time1 #SQL执行多长时间以上会记录到慢查询日志,0~10s log_slow_admin_statementsOFF #在写入慢查询日志的语句中包含缓慢的管理语句。 …

duration java_Java Duration类| ofHours()方法与示例

duration javaDuration Class of Hours()方法 (Duration Class ofHours() method) ofHours() method is available in java.time package. ofHours()方法在java.time包中可用。 ofHours() method is used to represent the given hours in this Duration. ofHours()方法用于表示…

sumo的简单应用_sumo快速运行简单仿真实例详细教程

本文旨在让大家快速的了解sumo,并给出运行一个简单的sumo的例子的教程,进而了解基本sumo工程的架构,使大家对该软件产生兴趣并持续学习下去,刚开始学习仿真的确枯燥,项目“跑起来”才是大家学习下去的动力,…

stl vector 函数_vector :: crbegin()函数,以及C ++ STL中的示例

stl vector 函数C vector :: crbegin()函数 (C vector::crbegin() function) vector::crbegin() is a library function of "vector" header, it is used to get the last element of a vector using const_reverse_iterator, it returns a const reverse iterator …

ReactNative学习笔记(二)Flex布局

flexDirection 决定主轴方向 column:垂直方向为主轴row:水平方向为主轴justifyContent 决定主轴元素排列方式 flex-startflex-endcenterspace-betweenspace-aroundalignItems 决定侧轴元素排列方向 flex-startflex-endcenterbaselinestretch

cad导出 dxf后中文不显示_CAD快速看图 for Mac

CAD快速看图 for Mac是一款非常小巧、快速、方便的DWG看图工具,CAD快速看图 Mac版可脱离AutoCAD最快速、最方便浏览DWG和DXF图纸,支持二维或三维图纸,支持高清、多文件和云字体,非常实用的一款CAD看图软件,CAD快速看图…