dst

时区问题备忘

淺唱寂寞╮ 提交于 2019-12-22 00:38:54
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> ####CST 仅仅指美国中部时间。 美国横跨西五区至西十区,共六个时区。每个时区对应一个标准时间,从东向西分别为东部时间(EST)(西五区时间)、中部时间(CST)(西六区时间)、山地时间(MST)(西七区时间)、太平洋时间(西部时间)(PST)(西八区时间)、阿拉斯加时间(AKST)(西九区时间)和夏威夷时间(HST)(西十区时间),按照“东早西晚”的规律,各递减一小时; 若将字母S变成了D, 则表示夏令时,会减一个时区,即提前1小时; ####DST 「夏日节约时间」(Daylight Saving Time),英国称「夏令时」(Summer Time); ####GMT 「格林威治标准时间」(Greenwich Mean Time),时区划分的由来,从1970年开始; ####UTC 「协调世界时」(Universal Time Coordinated),与太阳保持精确同步,有闰秒的概念(其误差值必须保持在0.9秒以内,若大于0.9秒则由位于巴黎的国际地球自转事务中央局发布闰秒),从1900年开始。 Java对序列化时间关于时区的反序列化参见: https://git.oschina.net/wei.chou/Wei.Lib2A/blob/master/Wei.Lib2A/src/hobby/wei/c

Problems with finding the days between two unix timestamps

爱⌒轻易说出口 提交于 2019-12-22 00:28:49
问题 I know there a lot of questions and answers of this already, but unfortunately I think my situation may be unique? For some reason, the time-change seems to be making the day calculate as one day less than it should be calculating. Here is my PHP that I was using and it was working great, until it started to overlap a start and end date that was BEFORE daylight savings, and AFTER daylight savings, respectively (FYI, this is a recent issue, since daylight savings time starts this weekend!): //

Oracle.ManagedDataAccess reads DST dates incorrectly

柔情痞子 提交于 2019-12-21 23:09:23
问题 I am writing a .Net application that runs on top of an Oracle 11.2.0.2.0 database that stores dates in columns of type "TIMESTAMP(6) WITH LOCAL TIME ZONE". When there is a date stored into the column and it falls within DST, the date is read incorrectly when using the Oracle.ManagedDataAccess library. It appears to always write/update dates correctly. Also, when using the Oracle.DataAccess library, it always handles the dates correctly. In my example I am using timezone 'America/New_York' and

Oracle.ManagedDataAccess reads DST dates incorrectly

别说谁变了你拦得住时间么 提交于 2019-12-21 22:57:54
问题 I am writing a .Net application that runs on top of an Oracle 11.2.0.2.0 database that stores dates in columns of type "TIMESTAMP(6) WITH LOCAL TIME ZONE". When there is a date stored into the column and it falls within DST, the date is read incorrectly when using the Oracle.ManagedDataAccess library. It appears to always write/update dates correctly. Also, when using the Oracle.DataAccess library, it always handles the dates correctly. In my example I am using timezone 'America/New_York' and

Find current time in ET: EST or EDT, as appropriate

谁都会走 提交于 2019-12-21 17:54:23
问题 I have an application which needs to use Eastern Time for a certain part of the calculation rather than the local time. I suppose this could all be done manually (extract UTC time, decide whether daylight savings is in effect by a table lookup, then shift by 4 or 5 hours as appropriate) but I wondered if there was a built-in way of doing this. Also, weren't there changes to DST recently in the US? (I need to follow US rules on daylight savings.) I wonder if those were incorporated into

Why doesn't subtracting two local DateTime values appear to account for Daylight Saving Time?

送分小仙女□ 提交于 2019-12-21 17:45:32
问题 I'm playing with some C# code to try to gain an understanding of how subtracting DateTime objects in C# works with respect to Daylight Saving Time. Per Google and other sources, the Daylight Saving Time "spring ahead" event in the Eastern Standard Time zone in 2017 was at 2:00am on March 12. So, the first few hours of the day on that date were: 12:00am - 1:00am 1:00am - 2:00am (There was no 2:00am - 3:00am hour due to the "spring ahead") 3:00am - 4:00am So, if I were to calculate the time

C++ timegm conversion DST to a certain timezone at a given time in the future?

余生长醉 提交于 2019-12-20 07:34:45
问题 I need an accurate conversion in my class from UTC time to local time of a given timezone, with or without DST in effect. My problem is, that when I use struct tm I have to provide the tm_isdst member, or leave it -1 to be determined automatically. from mktime(3) - linux man page: "The value specified in the tm_isdst field informs mktime() whether or not daylight saving time (DST) is in effect for the time supplied in the tm structure: a positive value means DST is in effect; zero means that

C++ timegm conversion DST to a certain timezone at a given time in the future?

China☆狼群 提交于 2019-12-20 07:34:20
问题 I need an accurate conversion in my class from UTC time to local time of a given timezone, with or without DST in effect. My problem is, that when I use struct tm I have to provide the tm_isdst member, or leave it -1 to be determined automatically. from mktime(3) - linux man page: "The value specified in the tm_isdst field informs mktime() whether or not daylight saving time (DST) is in effect for the time supplied in the tm structure: a positive value means DST is in effect; zero means that

Why doesn't C# detect that 1970/1/1 was under BST?

非 Y 不嫁゛ 提交于 2019-12-20 04:18:56
问题 I'm working with a 3rd party API that returns Time of Day values as DateTime values filling in Jan 1, 1970 as the date part. So for 5AM, it will return something like 1969-12-31T21:03:00.000-08:00 The problem is that, when if the user was on London time, C# fails to apply BST adjustment for 1970-01-01. For example, 1970-01-01 5AM in UTC should be 1970-01-01 6AM in London. See conversion But, C# doesn't seem to apply this conversion: var utcTime = new DateTime(1970, 1, 1, 5, 0, 0, DateTimeKind

Convert unix timestamp between different timezones and different DST in Java

半腔热情 提交于 2019-12-20 04:13:08
问题 PROBLEM SOLVED External device was computing and sending non-standard 2 hours shifted timestamp, which hugely confused me and started this thread. TIMESTAMP BY ITSELF IS NOT AFFECTED BY TIMEZONES , timezones apply only when converting in/from human readable forms. I have timestamp (seconds from unix epoch) in UTC timezone - no DST (daylight saving time). I want timestamp (seconds from unix epoch) in "Europe/Prague" timezone, that uses DST. I used to think that unix timestamp is unbound by