java timezone_Java TimeZone useDaylightTime()方法与示例
java timezone
TimeZone类useDaylightTime()方法 (TimeZone Class useDaylightTime() method)
useDaylightTime() method is available in java.util package.
useDaylightTime()方法在java.util包中可用。
useDaylightTime() method is used to check whether this time zone uses daylight savings time or not.
useDaylightTime()方法用于检查此时区是否使用夏时制。
useDaylightTime() method is a non-static method, it is accessible with the class object only and if we try to access the method with the class name then we will get an error.
useDaylightTime()方法是一种非静态方法,只能通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。
useDaylightTime() method does not throw an exception at the time of checking daylight savings.
useDaylightTime()方法在检查夏时制时不会引发异常。
Syntax:
句法:
public abstract boolean useDaylightTime();
Parameter(s):
参数:
It does not accept any parameter.
它不接受任何参数。
Return value:
返回值:
The return type of the method is boolean, it returns true when this time zone uses DST (daylight savings time) otherwise it returns false.
方法的返回类型为boolean ,当该时区使用DST(夏令时)时返回true,否则返回false。
Example:
例:
// Java program to demonstrate the example
// of boolean useDaylightTime() method
// of TimeZone
import java.util.*;
public class UseDaylightTimeOfTimeZone {public static void main(String args[]) {// Instantiates two TimeZone object
TimeZone tz = TimeZone.getTimeZone("Africa/Asmera");
// Display tz
System.out.println("tz: " + tz);
// By using useDaylightTime() method is to
// check whether time zone tz use daylight time or
// not
boolean status = tz.useDaylightTime();
System.out.print("tz.useDaylightTime(): ");
System.out.println(status);
}
}
Output
输出量
tz: sun.util.calendar.ZoneInfo[id="Africa/Asmera",offset=10800000,dstSavings=0,useDaylight=false,transitions=6,lastRule=null]
tz.useDaylightTime(): false
翻译自: https://www.includehelp.com/java/timezone-usedaylighttime-method-with-example.aspx
java timezone
java timezone_Java TimeZone useDaylightTime()方法与示例相关推荐
- java getid_Java TimeZone getID()方法与示例
TimeZone类getID()方法getID()方法在java.util包中可用. getID()方法用于返回此TimeZone的ID. getID()方法是一种非静态方法,只能通过类对象访问,如果 ...
- java散列法的运用实例,Java HashMap compute() 使用方法及示例
Java HashMap compute() 使用方法及示例 Java HashMap compute()方法计算一个新值,并将其与哈希映射中的指定键相关联. compute()方法的语法为: has ...
- math的用法在java中的使用,Java Math cbrt() 使用方法及示例
Java Math cbrt() 使用方法及示例 Java Math cbrt()方法返回指定数字的立方根. cbrt()方法的语法为: Math.cbrt(double num) 注意:cbrt() ...
- java arraylist 方法返回值,Java ArrayList get() 使用方法及示例
Java ArrayList get() 使用方法及示例 Java ArrayList get()方法返回指定位置存在的元素. get()方法的语法为: arraylist.get(int index ...
- java timezone_Java TimeZone getDSTSavings()方法与示例
java timezone TimeZone类的getDSTSavings()方法 (TimeZone Class getDSTSavings() method) getDSTSavings() me ...
- java timezone_Java TimeZone inDaylightTime()方法及示例
java timezone TimeZone类inDaylightTime()方法 (TimeZone Class inDaylightTime() method) inDaylightTime() ...
- java timezone_Java TimeZone setID()方法与示例
java timezone TimeZone类的setID()方法 (TimeZone Class setID() method) setID() method is available in jav ...
- java timezone_Java TimeZone setDefault()方法与示例
java timezone TimeZone类的setDefault()方法 (TimeZone Class setDefault() method) setDefault() method is a ...
- java timezone_Java TimeZone getAvailableIDs()方法与示例
java timezone TimeZone类的getAvailableIDs()方法 (TimeZone Class getAvailableIDs() method) Syntax: 句法: pu ...
最新文章
- 将要看的两本书 - Hide From All - ITeye技术网站
- 【10】青龙面板之JD ck 获取的1种办法
- 行高 line-height
- 硬件结构(中):EqualLogic PS5000 对等存储“动车组”
- Bumblebee微服务网关之负载策略
- Java中带有JWebSocket的WebServerSocket
- linux网站如何添加swf支持,linux下安装swftools和openOffice
- C语言字符串倒排,C语言兑现简单的倒排文件索引
- c mysql 双主复制_mysql双主复制总结
- ReportViewer教程(15)-矩阵报表-1
- Python 绑定:从 Python 调用 C 或 C++
- jQuery入门:认识jQuery
- mysql mysqldump触发器备份_MySQL常用的备份工具之mysqldump
- 矩池云Jupyterlab支持download as pdf
- Docker设置容器CPU、memory、磁盘IO资源限制
- this关键字在构建错误实例时使用说明
- 物联网技术概论:第2章
- linux ipv6 前缀 定义,家庭拨号动态前缀IPv6环境下的内部设备IPv6地址的端口放通...
- 【Python爬虫】获取全国客运列车车次及起讫站点位置信息
- python电子书在线阅读-Python编程快速上手 让繁琐工作自动化
热门文章
- css提取页面元素唯一性_下面这个函数,能够获取一个元素的任意 CSS 属性值。...
- sqli-lab——Writeup(38~over)堆叠等......
- c# mysql数据库查询语句_C# mysql 查询
- 存储器是计算机的记忆装置,存储器(Memory)
- HDFS常用Shell命令
- 洛谷P2014【树形dp】
- Triangle Counting【数学】
- 嵌入式BootLoader技术内幕(二)
- 搭建基于C#和 Appium 的 Android自动测试环境
- 数据中心部署气流遏制系统需要考虑的十大要素