dst

Android AlarmManager and DST/Timezone/Time change?

送分小仙女□ 提交于 2019-12-23 09:30:45
问题 I'm coding an alarm clock application, and i would like to know what happens, when I set some alarm with AlarmManager for example at time 2:59am (this is not time of my alarm, this is only time WHEN i set some alarm), and at 3:00am there will be automatic time change from summer time to winter (DST). What happens with my scheduled alarm? I found nothing in docs, and it's not so easy to test, at least I must change dates and wait few hours...I'm not so patient ;) Next problem - I was also

How to find next day's Unix timestamp for same hour, including DST, in Python?

て烟熏妆下的殇ゞ 提交于 2019-12-23 09:18:05
问题 In Python, I can find the Unix time stamp of a local time, knowing the time zone, like this (using pytz): >>> import datetime as DT >>> import pytz >>> mtl = pytz.timezone('America/Montreal') >>> naive_time3 = DT.datetime.strptime('2013/11/03', '%Y/%m/%d') >>> naive_time3 datetime.datetime(2013, 11, 3, 0, 0) >>> localized_time3 = mtl.localize(naive_time3) >>> localized_time3 datetime.datetime(2013, 11, 3, 0, 0, tzinfo=<DstTzInfo 'America/Montreal' EDT-1 day, 20:00:00 DST>) >>> localized_time3

Windows 7 daylight savings bug?

帅比萌擦擦* 提交于 2019-12-23 08:46:50
问题 I am trying to determine exactly when a daylight savings transition occurs in a Perl script using Perl's localtime function and printing the time zone using strftime . The strange thing is this seems to work fine for this year and other more recent years, but if I try and go back to the year 2000 for example, Perl seems to think the transition occurs on the wrong day! According to Google, daylight savings started on April 2nd in the year 2000: ...but for some reason, the Perl code below seems

Historical daylight savings in Windows

女生的网名这么多〃 提交于 2019-12-22 12:16:42
问题 Is there a easy way in Windows (using Delphi, not .NET) to convert UTC times to a local time, with daylight saving adjustments. Data goes back 12 years, so needs to take account of changes in DST start/end dates over that time. 回答1: Funny, a very similar question appeared yesterday on LinkedIn. This is the answer I gave there: Time Zones are somewhat fluid, especially when Daylight Saving Time starts/finishes. This database ( http://en.wikipedia.org/wiki/Tz_database ) defines the time zones,

Detect if the DST is currently enabled

放肆的年华 提交于 2019-12-22 09:12:17
问题 I need to find an easy way to know if the local machine's 'automatically adjust clock for Daylight Saving Time' option is enabled. If the option's on, I need to know whether it is currently applied (i.e. is it DST currently in the system). Thanks in advance 回答1: You can find the current system default time zone and whether it is currently using DST (Daylight Saving Time) like this (.NET 3.5 onwards): TimeZoneInfo zone = TimeZoneInfo.Local; if (zone.SupportsDaylightSavingTime) { Console

How to detect Daylight Saving Time transition in android

狂风中的少年 提交于 2019-12-22 07:50:36
问题 I have an android app that has a service witch fires an alert based on some time calculation. The problem is when the timezone changes ( i.e.: For a user who's located France and goes from UTC+1 to UTC+2 ). The application is not notified about this change and so, it fires the alert with a delay. I have already checked android TimeZone API and know that there are some methods which can help, like: useDaylightTime() inDaylightTime(Date time) getDSTSavings() IS IT POSSIBLE to know when the

Need to display local times over DST transitions using Javascript Date Object

烂漫一生 提交于 2019-12-22 05:25:07
问题 I am trying to output a series of times in hour (on the hour) intervals within Javascript (so inside a web browser such as Firefox). This series of times will overlap the short day (losing an hour in spring) and long day (gaining an hour in autumn). The output I'm looking for is in local time, i.e. with timezone and DST offsets applied. So for example, in the UK we have a missing hour from 01:00 to 01:59 on the short day such that the output would be: 00:00, 02:00, 03:00 And on the long day

Timestamp calculation with daylight saving time

只谈情不闲聊 提交于 2019-12-22 05:20:15
问题 The Central European Daylight Saving Time begins on last Sunday in March. We set our clocks from 02:00 to 03:00. What happens if I do timestamp calcuations in a database request - lets say at 01:59? UPDATE sessions SET aliveuntil = (CURRENT_TIMESTAMP + INTERVAL '1' MINUTE) WHERE id = ? Do I get 03:00 as result or 02:00? And what about the over way around if we set our clocks from 03:00 to 02:00? SELECT id FROM sessions WHERE aliveuntil < (CURRENT_TIMESTAMP - INTERVAL '1' MINUTE) After time

Node JS current DST rules

老子叫甜甜 提交于 2019-12-22 05:11:31
问题 According to specifications, Node JS (ES5) should use current dts rules when working with Date objects. Current means "for now", not for a particular date. That's not perfect, but enough for me at this moment. Currently that rules are wrong (due to law changes in Chile). Simple probe: console.log(new Date()) Mon Apr 08 2019 12:48:08 GMT-0300 (Chile Summer Time) {} shows "(Chile Summer Time)" at the end of the default toString for a date. Actually we are not in Summer Time (it ended two days

Node JS current DST rules

谁都会走 提交于 2019-12-22 05:11:30
问题 According to specifications, Node JS (ES5) should use current dts rules when working with Date objects. Current means "for now", not for a particular date. That's not perfect, but enough for me at this moment. Currently that rules are wrong (due to law changes in Chile). Simple probe: console.log(new Date()) Mon Apr 08 2019 12:48:08 GMT-0300 (Chile Summer Time) {} shows "(Chile Summer Time)" at the end of the default toString for a date. Actually we are not in Summer Time (it ended two days