How to work with TimeZone UTC, IST, EST in ASP.NET?

Using this script you can get the time difference between your local time and UTC time. You can use get the Time zone Name by curTimeZone.StandardName, you can check is IsDaylightSavingTime etc

 TimeZone curTimeZone = TimeZone.CurrentTimeZone;
  TimeSpan currentOffset = curTimeZone.GetUtcOffset(DateTime.Now);
  string TotalSeconds = Convert.ToString(currentOffset.TotalSeconds );

You can get values either Seconds, Minutes, Hours , Days etc    by currentOffset.TotalMinutes.......

If you want to get the Client system time or user's local time then you have to use Javascript. Becuase ASP.Net code execute on server, so it can only return datetime as on server. Click on the below link to view the complete code to get client time in C# using Javascript


Related Alrticles

FREE!!! Registration