Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

How to convert TimeZone to UTC Time And then to GMT

$
0
0

Hi,

I have requirement where I will get TimeZone Name. According to the time Zone I have to get the GMT of that TimeZone.

I have written code as 

       String TimeZone_Var = Convert.ToString(Row.TimeZone);
        TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(TimeZone_Var);
        Row.scheduledstart = TimeZoneInfo.ConvertTimeFromUtc(Row.scheduledstart, timeZoneInfo);
        Row.scheduledend = TimeZoneInfo.ConvertTimeFromUtc(Row.scheduledend, timeZoneInfo);
        TimeSpan diffdate = Row.scheduledend.Subtract(Row.scheduledstart);
        Row.scheduleddurationminutes = Convert.ToInt16(diffdate.TotalMinutes);
        Row.Testingtimezone = timeZoneInfo.DisplayName.ToString(); 

Example ScheduleStart=2012-10-12-14:00:00.000 And ScheduleEnd=2012-10-12 16:00:00.000

I need to get the Time in GMT

Please help me out.


Regards, Kishlay Anand


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>