DayLight Saving in Derived Column
-
Tuesday, August 30, 2011 3:38 PM
Hi All,
I am receiving some orders as an XML. Those orders need to be loaded to SQL Server.
The order date is in GMT. I need to convert it to EST and handle DayLight Saving too.
Is it possible to do using the existing functions in SSIS?
Else, i guess i will have to create a procedure to update the dates once they get loaded.
Or let me know if there is any other method.
Thanks!
Answers
-
Tuesday, August 30, 2011 4:19 PM
One thing you could do is pump the rows through a script component and do the conversions. The C# .NET code to do it would be:
TimeZoneInfo timeZoneGMT; TimeZoneInfo timeZoneEST; DateTime Converted_dateTime; timeZoneGMT = TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time"); timeZoneEST = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); Converted_dateTime = TimeZoneInfo.ConvertTime(DateTimeFromXML, timeZoneGMT, timeZoneEST);
Tom Overton- Proposed As Answer by COZYROC Tuesday, August 30, 2011 4:53 PM
- Marked As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Sunday, September 04, 2011 5:41 AM
All Replies
-
Tuesday, August 30, 2011 4:01 PM
There are no stock (existing functions to handle the GMT time and/or Daylight savings). Reason is it is very much dependent on the local settings.
For example some timezones are having 30 min time intervals. Some places do not honor the daylight saving rules, and many are opting out of this program I think this year.
To suggest you on how to update the dates, you better post here how the records are flowing in. Example: in one of my ETLs I have a XML in which the date has a timezone indicator:
<TimeStamp2>1976-02-18T17:52:06</TimeStamp2>
Is that the case with your request, too?
Arthur My Blog

-
Tuesday, August 30, 2011 4:19 PM
One thing you could do is pump the rows through a script component and do the conversions. The C# .NET code to do it would be:
TimeZoneInfo timeZoneGMT; TimeZoneInfo timeZoneEST; DateTime Converted_dateTime; timeZoneGMT = TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time"); timeZoneEST = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); Converted_dateTime = TimeZoneInfo.ConvertTime(DateTimeFromXML, timeZoneGMT, timeZoneEST);
Tom Overton- Proposed As Answer by COZYROC Tuesday, August 30, 2011 4:53 PM
- Marked As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Sunday, September 04, 2011 5:41 AM
-
Tuesday, August 30, 2011 4:54 PM


