Convert DateTime into Specific TimeZone wise with DayLightSavingTime Changes

DateTime date1 = Convert.ToDateTime(“15-03-2010 3:30:00 AM”); //start day of daylighttime //DateTime date1 = Convert.ToDateTime(“07-11-2010 3:30:00 AM”); //DateTime date1 = Convert.ToDateTime(“08-11-2010 3:30:00 AM”); // end day of daylighttime //set local timezone TimeZoneInfo sourceTimeZone = TimeZoneInfo.Local; //get system timezones list System.Collections.ObjectModel.ReadOnlyCollection timeZone = TimeZoneInfo.GetSystemTimeZones(); List tz = timeZone.ToList(); //get event time zone standard name epp2ClientPL.EventConfigurationProperties result = …

Datatable.Copy() & DataTable.Clone() ???

DataTable dtCopy = table.Copy(); it will create “dtCopy” datatable with the records from “table”, DataTable dtClone = table.Clone(); it will create “dtClone” datatable without any records. it only copy structure of “table” datatable. DataTable dtCopy = dataViewTable.ToTable().copy(); it will create “dtCopy” datatablw with records only contains in DataView.

TimeZone : Get the date and time as per time zone

//Get the Collection of System’s Time Zones. System.Collections.ObjectModel.ReadOnlyCollection timeZone = TimeZoneInfo.GetSystemTimeZones(); //Convert time zone collection to LIST List tz = timeZone.ToList(); string strZone=””; try { strZone = tz.AsEnumerable().Where(u => u.DisplayName == “(UTC+01:00) West Central Africa”).SingleOrDefault().StandardName.ToString(); } catch (Exception ex) { Console.WriteLine(ex.Message.ToString()); } TimeZoneInfo timeZone1 = TimeZoneInfo.Local; TimeZoneInfo timeZone2 = TimeZoneInfo.FindSystemTimeZoneById(strZone.ToString()); Console.WriteLine(“================= Time Zone =============”); Console.WriteLine(timeZone1.DisplayName); …