dst

Check if DST is in effect

喜你入骨 提交于 2019-12-10 23:41:43
问题 In PHP, date('I') will tell me if Daylight Savings Time is in effect. Does this tell me if DST is in effect specifically for my server's configured timezone, or whether or not it's in effect period? I'm in Arizona where we don't observe DST. So I need my server to recognize that, say, New York is 2 hours ahead of me right now, but when DST kicks in March next year that it's 3 hours ahead of me. Update: Given the comment that it's for my server's configured time zone, how would I go about

TimeZoneInfo DST vs Windows settings

眉间皱痕 提交于 2019-12-10 21:07:49
问题 Does TimeZoneInfo.SupportsDaylightSavingTime reflect the disabled/enabled status of "Adjust for daylight saving time automatically" in Windows date & time settings? I'm trying to replicate those settings in a kiosk mode app where Windows is inaccessible for the user, and I've managed to get everything working including setting timezones with or without DST using tzutil, but while testing I noticed that some timezones DST settings (like Moscow) were not in sync with Windows. We know that

rails' utc_to_local and daylight savings time

这一生的挚爱 提交于 2019-12-10 19:16:20
问题 > e = Event.first > e.registration_start_utc #registration_start_utc is a datetime column => Sat, 23 Oct 2010 06:38:00 UTC +00:00 > e.registration_start_utc.utc? => true > ActiveSupport::TimeZone.find_tzinfo("America/New_York").utc_to_local(e.registration_start_utc) => Sat, 23 Oct 2010 02:38:00 UTC +00:00 2 questions about this: 1) Why is that last output showing "UTC" -- the hour got converted (6 => 2) but it still says UTC. Why not EST/EDT? 2) What happens after daylight savings time

Is it possible to get a timezone in Python given a UTC timestamp and a UTC offset?

六眼飞鱼酱① 提交于 2019-12-10 18:39:44
问题 I have data that is the UTC offset and the UTC time. Given that, is it possible in Python to get the user's local timezone (mainly to figure if it is DST etc. probably using pytz), similar to the function in PHP timezone_name_from_abbr ? For example: If my epoch time is 1238720309, I can get the UTC time as: >>> d = datetime.utcfromtimestamp(1238720309) >>> print d + dt.timedelta(0,-28800) #offset for pacific I think 2009-04-02 17:04:41.712143 This is correct except it is PDT right now, so it

What's wrong with '2018-03-22 00:00:00" in MySQL?

扶醉桌前 提交于 2019-12-10 18:31:19
问题 I want to update a date field and set it to 2018-03-22 00:00:00 but I get the following stupid error: Error Code: 1292. Incorrect datetime value: '2018-03-22 00:00:00' for column 'Date' at row 158917 This is the query I use for updating: update assets.transactions set date = date_add(date, interval 1 hour) where date between '2018-03-21 23:00:00' and '2018-06-29 23:59:59'; What is wrong? I searched a lot and found out dates before 1970-01-01 00:00:01 are not supported by MySQL, that is

.NET TimeZone.CurrentTimeZone.GetDaylightChanges returns wrong DST for 2005

别说谁变了你拦得住时间么 提交于 2019-12-10 17:55:25
问题 I used the following code to display the Daylight Saving Time for the years between 2005 and 2035. For the year 2005, this page shows the DST is between April 3rd and October 30th. But the GetDaylightChanges returns March 13 and November 6th. Is the .NET GetDaylightChanges a reliable function? public static void GetCurrentTimeZone() { for (int i = 0; i < 30; i++) { var dlt = TimeZone.CurrentTimeZone.GetDaylightChanges(2005 + i); Console.WriteLine(2005 + i); Console.WriteLine(dlt.Start

How do you determine Daylight Savings Time in VBA?

两盒软妹~` 提交于 2019-12-10 15:52:07
问题 What function will let us know whether a date in VBA is in DST or not? 回答1: For non-current dates (DST 2007+): First, you need a function to find the number of specific weekdays in a month: Public Function NDow(Y As Integer, M As Integer, _ N As Integer, DOW As Integer) As Date ' Returns Date of Nth Day of the Week in Month NDow = DateSerial(Y, M, (8 - Weekday(DateSerial(Y, M, 1), _ (DOW + 1) Mod 8)) + ((N - 1) * 7)) End Function Then, you can check for the DST day versus the following

Duration with daylight saving

梦想的初衷 提交于 2019-12-10 10:55:40
问题 I have an object Shift , with two fields: startDateTime and endDateTime as DateTime from Joda-Time. And my shift includes Daylight Saving UK change. It starts on 25/03/2017 13:00 and ends on 26/03/2017 02:00 (basically should end on 26/03/2017 01:00 , but this date does not exists, and endDate is shifted +1 hour). According to this site: When local standard time was about to reach Sunday, 26 March 2017, 01:00:00 clocks were turned forward 1 hour to Sunday, 26 March 2017, 02:00:00 local

Python pandas tz_localize throws NonExistentTimeError, then unable to drop erroneous times

隐身守侯 提交于 2019-12-10 10:53:26
问题 In python pandas, I have a dataset that looks like this: For data before 2007-04-26 17:00:00, the time zone is US/Eastern. For data after, the time zone is American/Chicago. When I run this: data.index = data[:'2007-04-26 16:59:59'].index.tz_localize('US/Eastern', ambiguous = 'NaT').tz_convert('Europe/London') I get an error that says: NonExistentTimeError: 2006-04-02 02:00:00 This is indeed because of daylight savings time. I have the same problem for 2007. I don't have the problem for

Generating a schedule that works over different timezones and DSTs

☆樱花仙子☆ 提交于 2019-12-10 10:47:31
问题 I'm building a web app that coaches people to rise earlier, it generates a rising schedule for the user over a seventy day period. They input their current rising time and their target rising time. The rising time then diminishes a set amount on a weekly basis until it reaches the target time. The user has to login to the website and 'check in' at their scheduled time. I'm at a bit of a loss as to how I generate this plan, taking into account the timezone and DST of the currently logged in