时区 : 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 ...
随机推荐
- 如何在eclipse使用StaggeredGridView
概述 现在的开发工具基本都用AndroidStudio了.网上的开源框架也是.比如做瀑布式UI的StaggeredGridView,还有导航页的PagerSlidingTabStrip等. 那么电脑 ...
- 从URI中获取实际的文件path
如题,经常用在onActivityResult方法中解析图片等各种地址,因为Android 4.4之后google更改了对应的方法. /** * Get a file path from a Uri. ...
- iOS 设置图片imageView圆角——对图片进行裁剪
以前设置图片圆角总是把imageView设置成圆形,然后设置maskToBounds为YES,其实这样处理很消耗性能,图片多了之后比较卡,最好将图片进行裁剪后显示:这里有个分类可以用: UIImage ...
- IOS GCD 的理解
GCD (Grand Central Dispatch) 是Apple公司开发的一种技术,它旨在优化多核环境中的并发操作并取代传统多线程的编程模式. 在Mac OS X 10.6和IOS 4.0之后开 ...
- 关于arcgis 9.3破解问题详解
对于初学GIS的同学,安装软件可能会遇到各种各样的问题,对于photoshop,autocad,sketchup,3dmax等软件我们的我们无非是输入特定序列号或者用工具随机生成特定序列号就可以破解, ...
- javascript 获取url参数
/** window.location.search获取url地址?以后的值 获取url参数有两种方法,第一种如下,第二种是通过正则 */ //基本版 function getParam() { va ...
- java新手笔记12 单例
1.单例 package com.yfs.javase; public class Singleton { //private static final Singleton single = new ...
- 工作中的问题解决 -- (win2003 asp.net) Session和带页面回传的方法无法正常使用解决方案
公司BP&IT项目组.从上上个月成立开始开发BP&IT软件.这个月开始测试我悲剧的发现他尽然不支持我电脑上的IE11.半个多月还没解决 我们先来分析下原因首页 登陆页面正常浏览 htt ...
- Linux下的另一个词典GoldenDict
以前一直在用statdict,突然发现了一个好用的东西Goldendict. 转载丁香园上一篇文章:http://www.dxy.cn/bbs/topic/20455142 Goldendict 话说 ...
- Codeforces Round #299 (Div. 1)
Problem A: 实际上对于一段数字假设和为k,每次取较大的m个进行t次减一操作,最多减去的是min(m*t,k). 明白了这个结论就可以直接二分答案了. #include <bits/st ...