2

My current time zone is GMT+05:30. & my time zone name is India Standard Time. If the current local time is 2014-03-08 10:31:09.0000000 then by using the below code what I get the output is 30 minutes delayed time. i.e. the time I get from server is 2014-03-08 10:01:09.0000000. How to correct the 30 minutes time difference so that I may get the time which is same as my local time. Can someone correct me if I'm wrong. And please help me clear my error.

string zoneId = "Indian Standard Time";
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(zoneId);
DateTime result = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow,tzi);
njnjnj
  • 978
  • 4
  • 23
  • 58
  • possible duplicate of [Get current date time from server and convert it into local time in c#](http://stackoverflow.com/questions/22279525/get-current-date-time-from-server-and-convert-it-into-local-time-in-c-sharp) – Matt Johnson-Pint Mar 10 '14 at 16:03
  • This code is already correct. You may just have the actual clock of the server set incorrectly. – Matt Johnson-Pint Mar 10 '14 at 16:04

1 Answers1

0

Could it be that it is just a typo? "India Standard Time" instead of "Indian Standard Time"

Karsten Gutjahr
  • 316
  • 2
  • 12