dst

How to set daylight saving to off in php

不想你离开。 提交于 2019-12-08 00:06:56
问题 I've got this line of code which set daylight saving "On" what would be the proper way to set it to "off" // is daylight saving On? $rcmail_config['dst_active'] = (bool)date('I'); 回答1: date('I') (that's a capital letter i) returns 1 when the current default time zone is in DST. If it's returning 1 instead of 0 and the timezone in question is not in DST , either the timezone you've picked is incorrect or the time zone data it uses is out of date. If you can, please try using a DateTime object

Need a SQL Server function to convert local datetime to UTC that supports DST

风流意气都作罢 提交于 2019-12-07 22:19:39
问题 We are migrating an application to Azure, but currently all of our dates are stored as Eastern Standard Time. Since SQL Azure is on UTC and many of our dates are generated from a getdate() call, we're going to have issues if we leave everything as it is. It seems that the option that will provide the least long term headache is to just convert all of our stored dates to UTC, and have them converted to local time on the front end. Unfortunately it seems that there isn't a built-in way to

Joda-Time, daylight savings calculation, timezone independent tests

蓝咒 提交于 2019-12-07 21:59:11
问题 We use fixed time periods in the application. When the user adds a new period, it should be by default from 6:00 AM to 6:00 AM the next day. Normally, it's 24 hours, but there is one issue : when the daylight saving change is performed, the length of that period changes. For example : 27 October 6:00 AM to 28 October 6:00 AM. In this period is performed change shift from CEST to CET time zone. Thus, this period contains 25 hours : From 27 October 6:00 AM to 28 October 3:00 AM - there are 21

Is return value of GetTimeZoneInformation also valid for dynamic DST zones?

空扰寡人 提交于 2019-12-07 20:34:03
问题 Following function which I have written in Delphi (however, my question is not specific to Delphi) does output the current UTC unix timestamp: function CurrentUnixTimeUTC: int64; var tzi: TTimeZoneInformation; begin // Get the current unix timestamp in local time. Result := DateTimeToUnix(Now); // First, add the DST specific bias case GetTimeZoneInformation(tzi) of TIME_ZONE_ID_INVALID: RaiseLastOSError; TIME_ZONE_ID_UNKNOWN: ; // Unknown what to do. We simply don't apply any bias. TIME_ZONE

Java Date and Daylight Saving

99封情书 提交于 2019-12-07 20:23:46
问题 I'm trying to print all the hours of the day using a for loop and incrementing a Date object. But I can't have "Sun Mar 25 02:00:00", I only have these: Sun Mar 25 01:00:00 CET 2012 Sun Mar 25 03:00:00 CEST 2012 Sun Mar 25 03:00:00 CEST 2012 Sun Mar 25 04:00:00 CEST 2012 Sun Mar 25 05:00:00 CEST 2012 I'm not interested in having the TimeZone. I think that the problem is due to the Daylight Saving, but I need the "Sun Mar 25 02:00:00". How can I do to create that date? 回答1: You probably want a

Ignoring DST when using Java Calendars

偶尔善良 提交于 2019-12-07 17:49:16
问题 I have a GUI that plots time-series graphs. The user enters the dates they want to plot from and to by entering values in text boxes. For example, if they enter 25/07/13 22:00 and 26/07/13 00:00 the graph should plot data from 22:00:00 on the 25th through to 00:00:59 the following morning. The times the user enters are parsed into a Calendar object. My problem comes with DST. The user doesn't care about DST, so all they want to see is a graph between those two times. However, the Calendar

Has the daylight savings rule change invalidated the C runtime library?

删除回忆录丶 提交于 2019-12-07 14:47:34
问题 Some time ago I put together a time based library that could be used for working out relative times within a year for someone. I noted at the time, that it did the one hour shift in both directions for daylight savings. It just occurred to me that Congress changed the daylight savings time rules. I don't recall seeing any information about updates to resolve the change in algorithms. Does anyone have any information on this topic? 回答1: Most Unix-like systems use the Olson tz database for

DateTime alters timestamp during DST winter change

安稳与你 提交于 2019-12-07 09:30:27
问题 Today encountered interesting feature (?) in PHP DateTime::setTimestamp() behavior. During winter DST changes, when 1 hour repeats twice, PHP converts timestamp to always be the second hour. Consider following example: <?php $date = new \DateTime("now", new \DateTimeZone("UTC")); //2018-10-28T01:30:00 UTC, in London DST happens $date->setTimestamp(1540686600); echo $date->getTimestamp() . "\n"; //1540686600 echo $date->format('c') . "\n"; //2018-10-28T00:30:00+00:00 $date->setTimezone(new

In Oracle, how can I detect the date on which daylight savings time begins / ends?

江枫思渺然 提交于 2019-12-07 04:16:57
问题 Is there a way in Oracle to select the date on which daylight savings will switch over for my locale? Something vaguely equivalent to this would be nice: SELECT CHANGEOVER_DATE FROM SOME_SYSTEM_TABLE WHERE DATE_TYPE = 'DAYLIGHT_SAVINGS_CHANGEOVER' AND TO_CHAR(CHANGEOVER_DATE,'YYYY') = TO_CHAR(SYSDATE,'YYYY'); -- in the current year Edit: I was hoping for a solution that would not require changes when Congress adjusts DST laws, as they did in 2007. The posted solutions will work, though. 回答1:

QuickBooks Web Connector TimeModified offset does not account for Daylight Savings time

对着背影说爱祢 提交于 2019-12-07 04:14:04
问题 I'm using QuickBooks Web Connector to pull employee records out of QuickBooks Desktop on a Windows 8.1 machine using QBXML requests. Is there a reason the TimeModified time stamps are returning an offset that does not account for Daylight Savings time? Is there a way to get the current time on the host system? It is currently returning "2014-03-27T14:20:53-05:00" for TimeModified, even though the current timezone is set to Eastern Time with "Adjust for Daylight Savings Time" enabled. The