时区 : America/Mexico_City 中文:美国中部时间(墨西哥城) 的夏令时
方法: (参数为:
TimeZone timeZone = TimeZone.getTimeZone("America/Mexico_City");
private static void testDayTime(TimeZone timeZone) {
System.out.println("Time Zone is : " + timeZone.getDisplayName() + " : " + timeZone.getID()); DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Calendar start = Calendar.getInstance(timeZone);
start.setTime(new Date(0)); // UTC 1970-01-01
System.out.println("start=" + df.format(start.getTime())); // will print: start=1970-01-01 08:00:00 Calendar end = Calendar.getInstance(timeZone);
end.add(Calendar.YEAR, 5);
System.out.println("end=" + df.format(end.getTime())); boolean find = false;
for (long i = start.getTimeInMillis(); i < end.getTimeInMillis(); i = start.getTimeInMillis()) {
start.add(Calendar.DATE, 1); // add one day if ((start.getTimeInMillis() - i) % (24 * 3600 * 1000L) != 0) { // 是否能被24整除
find = true; System.out.println("from " + df.format(new Date(i)) + " to " + df.format(start.getTime()) + " has "
+ (start.getTimeInMillis() - i) + "ms" + "[" + (start.getTimeInMillis() - i) / (3600 * 1000L)
+ "hours]");
} } if (!find) {
System.out.println("Every day is ok.");
}
}
I: Time Zone is : Central Standard Time : America/Mexico_City
I: start=1969-12-31 18:00:00
I: end=2021-01-07 21:24:34
I: from 1996-04-06 18:00:00 to 1996-04-07 18:00:00 has 82800000ms[23hours]
I: from 1996-10-26 18:00:00 to 1996-10-27 18:00:00 has 90000000ms[25hours]
I: from 1997-04-05 18:00:00 to 1997-04-06 18:00:00 has 82800000ms[23hours]
I: from 1997-10-25 18:00:00 to 1997-10-26 18:00:00 has 90000000ms[25hours]
I: from 1998-04-04 18:00:00 to 1998-04-05 18:00:00 has 82800000ms[23hours]
I: from 1998-10-24 18:00:00 to 1998-10-25 18:00:00 has 90000000ms[25hours]
I: from 1999-04-03 18:00:00 to 1999-04-04 18:00:00 has 82800000ms[23hours]
I: from 1999-10-30 18:00:00 to 1999-10-31 18:00:00 has 90000000ms[25hours]
I: from 2000-04-01 18:00:00 to 2000-04-02 18:00:00 has 82800000ms[23hours]
I: from 2000-10-28 18:00:00 to 2000-10-29 18:00:00 has 90000000ms[25hours]
I: from 2001-05-05 18:00:00 to 2001-05-06 18:00:00 has 82800000ms[23hours]
I: from 2001-09-29 18:00:00 to 2001-09-30 18:00:00 has 90000000ms[25hours]
I: from 2002-04-06 18:00:00 to 2002-04-07 18:00:00 has 82800000ms[23hours]
I: from 2002-10-26 18:00:00 to 2002-10-27 18:00:00 has 90000000ms[25hours]
I: from 2003-04-05 18:00:00 to 2003-04-06 18:00:00 has 82800000ms[23hours]
I: from 2003-10-25 18:00:00 to 2003-10-26 18:00:00 has 90000000ms[25hours]
I: from 2004-04-03 18:00:00 to 2004-04-04 18:00:00 has 82800000ms[23hours]
I: from 2004-10-30 18:00:00 to 2004-10-31 18:00:00 has 90000000ms[25hours]
I: from 2005-04-02 18:00:00 to 2005-04-03 18:00:00 has 82800000ms[23hours]
I: from 2005-10-29 18:00:00 to 2005-10-30 18:00:00 has 90000000ms[25hours]
I: from 2006-04-01 18:00:00 to 2006-04-02 18:00:00 has 82800000ms[23hours]
I: from 2006-10-28 18:00:00 to 2006-10-29 18:00:00 has 90000000ms[25hours]
I: from 2007-03-31 18:00:00 to 2007-04-01 18:00:00 has 82800000ms[23hours]
I: from 2007-10-27 18:00:00 to 2007-10-28 18:00:00 has 90000000ms[25hours]
I: from 2008-04-05 18:00:00 to 2008-04-06 18:00:00 has 82800000ms[23hours]
I: from 2008-10-25 18:00:00 to 2008-10-26 18:00:00 has 90000000ms[25hours]
I: from 2009-04-04 18:00:00 to 2009-04-05 18:00:00 has 82800000ms[23hours]
I: from 2009-10-24 18:00:00 to 2009-10-25 18:00:00 has 90000000ms[25hours]
I: from 2010-04-03 18:00:00 to 2010-04-04 18:00:00 has 82800000ms[23hours]
I: from 2010-10-30 18:00:00 to 2010-10-31 18:00:00 has 90000000ms[25hours]
I: from 2011-04-02 18:00:00 to 2011-04-03 18:00:00 has 82800000ms[23hours]
I: from 2011-10-29 18:00:00 to 2011-10-30 18:00:00 has 90000000ms[25hours]
I: from 2012-03-31 18:00:00 to 2012-04-01 18:00:00 has 82800000ms[23hours]
I: from 2012-10-27 18:00:00 to 2012-10-28 18:00:00 has 90000000ms[25hours]
I: from 2013-04-06 18:00:00 to 2013-04-07 18:00:00 has 82800000ms[23hours]
I: from 2013-10-26 18:00:00 to 2013-10-27 18:00:00 has 90000000ms[25hours]
I: from 2014-04-05 18:00:00 to 2014-04-06 18:00:00 has 82800000ms[23hours]
I: from 2014-10-25 18:00:00 to 2014-10-26 18:00:00 has 90000000ms[25hours]
I: from 2015-04-04 18:00:00 to 2015-04-05 18:00:00 has 82800000ms[23hours]
I: from 2015-10-24 18:00:00 to 2015-10-25 18:00:00 has 90000000ms[25hours]
I: from 2016-04-02 18:00:00 to 2016-04-03 18:00:00 has 82800000ms[23hours]
I: from 2016-10-29 18:00:00 to 2016-10-30 18:00:00 has 90000000ms[25hours]
I: from 2017-04-01 18:00:00 to 2017-04-02 18:00:00 has 82800000ms[23hours]
I: from 2017-10-28 18:00:00 to 2017-10-29 18:00:00 has 90000000ms[25hours]
I: from 2018-03-31 18:00:00 to 2018-04-01 18:00:00 has 82800000ms[23hours]
I: from 2018-10-27 18:00:00 to 2018-10-28 18:00:00 has 90000000ms[25hours]
I: from 2019-04-06 18:00:00 to 2019-04-07 18:00:00 has 82800000ms[23hours]
I: from 2019-10-26 18:00:00 to 2019-10-27 18:00:00 has 90000000ms[25hours]
I: from 2020-04-04 18:00:00 to 2020-04-05 18:00:00 has 82800000ms[23hours]
I: from 2020-10-24 18:00:00 to 2020-10-25 18:00:00 has 90000000ms[25hours]
时区 : America/Mexico_City 中文:美国中部时间(墨西哥城) 的夏令时的更多相关文章
- ubuntu设置时区为美国中部时间西六区
查看当前ubuntu系统时区 date -R Fri, Dec :: + 显示的是东八区时间及北京时间 然后输入tzselect 按照提示修改对应时区 本例子修改为美国中部时间 西六区 ~$ tzse ...
- CST时区,MYSQL与JAVA-WEB服务器时间相差13个小时的问题
最近倒腾了一台阿里云主机,打算在上面装点自己的应用.使用docker安装了安装mysql后,发现数据库的存储的时间与java-web应用的时间差8个小时,初步怀疑是docker容器时区的问题.经过一系 ...
- 美国cst时间和夏令时
美国6 PM CST相当于北京时间几点? 换算北京时间是:8:00,上午8点,日期是第二天.(换算公式:18点+14小时=第二天8点) 6 PM CST:6:00 PM Central Standar ...
- jQuery 根据城市时区,选择对应的即时时间
我们的CRM系统中,下面是用jQuery 做了个时区小插件 如图: // 时区城市//$(function(){//所有城市和时间静态输出//var cityID = 170; //中国,北京//va ...
- wget 显示"英国中部时间",去掉烦人的刷屏显示
wget下载文件显示多行,进度条后面显示英国中部时间,非常让人郁闷. 本来英文是eta(Estimated Time of Arrival 预计到达时间),翻译错了,干脆去掉好了. 先要有两个个工具 ...
- 去掉wget烦人的 “eta(英国中部时间)” 提示
gentoo 里的 wget ,从1.12版本开始,就一直有个不影响功能的小毛病:由于中文翻译的失误,进度提示的时候,会被拉成很多行.原因就是原来英文的ETA这3个字母,被翻译成了 “eta(英国中部 ...
- Rails-Treasure chest1 (自定义Model网址;多语言包; 时区设置, TimeZone类; 格式日期时间; 表单单选UI; 表单多选UI;Select2 Plugin)
自定义Model网址: 随机值网址SecureRandom.base58 多语言包, 包括默认语言设置和user自设置. 时区设置, TimeZone类 ,增加user自选时区功能 格式日期时间: x ...
- (转)AIX修改系统时区的3种方法和AIX 时间问题(夏令时)
原文:http://blog.csdn.net/fuwencaho/article/details/28267283 http://www.wo81.com/tec/os/aix/2014-04-30 ...
- flutter showDatePicker显示中文日期_Flutter时间控件显示中文
flutter showDatePicker showTimePicker显示中文日期 1.配置flutter_localizations依赖 找到pubspec.yaml配置flutter_loca ...
随机推荐
- LigerUI API
参数列表 参数名 类型 描述 默认值 title String 表格标题 null width String|Int 宽度值,支持百分比 'auto' height String|Int 高度值,支持 ...
- 文件(夹)比较 Beyond Compare, Diff
文件(夹)比较 Beyond Compare, Diff, UltraCompare 1.Beyond Compare(无与伦比) 2.Diff 参考 1.diff详解
- HDU_2156 分数矩阵
Problem Description 我们定义如下矩阵: 1/1 1/2 1/3 1/2 1/1 1/2 1 ...
- OpenJudge 2775 文件结构“图”/ Poj 1057 FILE MAPPING
1.链接地址: http://bailian.openjudge.cn/practice/2775 http://poj.org/problem?id=1057 2.题目: 总时间限制: 1000ms ...
- 【ADO.NET】1、简单配置与使用
1.一些基础的知识点 ExecuteReader(); //返回查询到的数据,一次一行,用于 selectExecuteNonQuery(); //返回影响的行数,用于 delete,insert,u ...
- struts2与spring集成时action的class属性值意义
struts2单独使用时action由struts2自己负责创建:与spring集成时,action实例由spring负责创建(依赖注入).这导致在两种情况下struts.xml配置文件的略微差异. ...
- 使用远程链接数据库工具无法链接到 linxu 系统上的数据库配置 1045
1.远程连接上Linux系统,确保Linux系统已经安装上了MySQL数据库.登陆数据库.mysql -uroot -p(密码). 2. 创建用户用来远程连接 GRANT ALL PRIVILEGES ...
- jquery禁用a标签,jquery禁用按钮click点击
jquery禁用a标签方法1 $(document).ready(function () { $("a").each(function () { var textValue = $ ...
- linux下安装phpredis
一.redis安装 1. yum install redis (不行的先执行:yum install epel-release,再yum install redis) 2.启动服务 redis-ser ...
- 跨域、sql注入、xss攻击
这几天遇到这三个问题,现在简单的记录下来. 1.跨域 如我服务器的域名是www.test1.com,我在另一个服务器www.test2.com通过ajax访问www.test1.com的数据时,就引起 ...