dst

DateTimeOffset adding TimeSpan returns invalid UTC offset for its TimeZoneInfo

I am in the process of building a temporal expression library that must be properly globalized and therefore work in all available Time Zones. Now I seem to be stuck as I'm not sure how to retrieve adjusted dates from DateTimeOffset objects in the correct Daylight Savings Time (DST) when the transition boundary is crossed using any vari...

Daylight Saving Time in Javascript for 1974?

"During the "energy crisis" years, Congress enacted earlier starting dates for daylight time. In 1974, daylight time began on 6 January and in 1975 it began on 23 February. After those two years the starting date reverted back to the last Sunday in April. " (via http://aa.usno.navy.mil/faq/docs/daylight_time.php ) There appears to be a ...

linux - detecting change of system time

Is there a way to get notified when there is update to the system time from a time-server or due to DST change? I am after an API/system call or equivalent. It is part or my effort to optimize generating a value for something similar to SQL NOW() to an hour granularity, without using SQL. ...

Date/time conversion problem if moment is exactly at end of wintertime (non-DST)

In my application I need to calculate shifts using a pattern described in a file. Recently, at one of my customers the application was hanging because of the following reason: If you fill in a 'struct tm' with the exact moment at the end of the wintertime (non-DST) _mktime seems to return an incorrect result. The code looks like this: ...

DST change handling in a daemon process (*NIX)

In a *NIX environment, if I have a 24x7 running application, how do I handle DST changes? I am looking for a solution for my app written in C/C++. ...

JSON Feed for DST Start/Stop Dates

Does anyone know where I can find a JSON feed with the Daylight Saving Time start and stop dates for timezones? Since the transitions dates are arbitrary and could change at any time I don't really want to rely on the system time or a JavaScript formula. ...

Daylight saving time and Timezone best practices

I am hoping to make this question and the answers to it the definitive guide to dealing with daylight saving time, in particular for dealing with the actual change overs. If you have anything to add, please do Many systems are dependent on keeping accurate time, the problem is with changes to time due to daylight savings - moving the c...

Get Time in London

How can I get the current local wall clock time (in number of millis since 1 Jan 1970) in London? Since my application can run on a server in any location, I think I need to use a TimeZone of "Europe/London". I also need to take Daylight Savings into account i.e. the application should add an hour during the "summer". I would prefer to ...

Convert UTC DateTime to another Time Zone

I have a UTC DateTime value coming from a database record. I also have a user-specified time zone (an instance of TimeZoneInfo). How do I convert that UTC DateTime to the user's local time zone? Also, how do I determine if the user-specified time zone is currently observing DST? I'm using .NET 3.5. Thanks, Mark ...

NSDate - GMT on iPhone

I have the following code in a production application which calculates a GMT date from the date the user enters: NSDate *localDate = pickedDate; NSTimeInterval timeZoneOffset = [[NSTimeZone defaultTimeZone] secondsFromGMT]; // You could also use the systemTimeZone method NSTimeInterval gmtTimeInterval = [localDate timeIntervalSi...

Robocopy for Windows 2003 doesn't support /DST option

Does anyone know if it is possible to download the latest robocopy for Windows 2003. The latest version provides the /DST option which ignores time stamps changed due to BST (British Summer Time). Every time we do a build and sync our servers when we go +1/-1 hour it takes hours instead of minutes because it sees everything as changed. ...

is mktime() using date() daylight saving aware?

I've read through a few questions about this here on s.o. and none seem to ask or answer the question very bluntly: $ts_today = mktime( 0, 0, 0, date('m'), date('d'), date('Y') ); is this daylight saving aware? if not, how do i make mktime() daylight saving aware? ...

Subroutine to apply Daylight Bias to display time in local DST?

UK is currently 1 hour ahead of UTC due to Daylight Savings Time. When I check the Daylight Bias value from GetTimeZoneInformation it is currently -60. Does that mean that translating UTC to DST means DST = UTC + -1 * DaylightBias, ie negate and add? I thought in this case for instance adding Daylight Bias to UTC is the correct operatio...

Python daylight savings time

How do I check if daylight saving time is in effect? ...

Autodetect timezone in Rails given UTC offset and DST

I basically want to autodetect a user's timezone using Rails. I can use this JS code at the user's browser (http://www.onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/) to send a form with the UTC offset and the fact that the time zone observes DST during summer or not, in the user's time zone. Once I have that info ...

Daylight saving time of current tz

Hi, in my c++ software I've used Boost in some parts and also for the local time. OK, now my problem is to make a check if in my machine is active or not the DST. With the follow part of code I can know only the difference from the UTC time. In my case the difference is 2 hours because is active the DST ptime tLoc = second_clock::loca...

Get Timezone Information in VBA (Excel)

Hi I would like to determine a time offset to GMT/UTC (including daylight saving time) for different countries at a specific date in VBA. Any ideas? Thanks ...

Offset time for DST in one specific timezone using JavaScript

I need to offset the time by an hour if it's currently DST in the Pacific Time Zone. How can I determine the current daylight savings status of the Pacific Time Zone, regardless of the user's local timezone? Here's what I have so far. "dst" in line 4 is just a placeholder for a function that would tell me if daylight savings time is act...

Can I convert between timezones in SQL Server?

Right now I'm storing a number of records in SQL Server with a DATETIME column that stores the current timestamp using GETUTCDATE(). This ensures that we're always storing the exact date without having to worry about questions like "well is this 2:00 my time or 2:00 your time?" Using UTC ensures that we know exactly when it happened rega...

SQL Server - Get time (daylight savings aware) from another time zone

Hi, I'm looking for a way in SQL Server without using the .NET framework to find out the time in a given time zone, paying attention to daylight savings. However, this method also needs to take account for states (e.g. Arizona) that do NOT follow DST. There is a workaround if the server is located somewhere that does follow DST - subt...