Help: I have a server which is having time in GMT-07.00 hours. My local time is GMT+05.30 hours. I need to get current date and time from server and convert this date and time i
So you have the server's time, and you know the server's time zone? Then you can get the local time like this:
//Server: 09-Mar-2014 11:00:00 AM:
var serverTime = new DateTime(2014, 3, 9, 11, 00, 00);
var serverZone = TimeZoneInfo.FindSystemTimeZoneById("US Mountain Standard Time");
var localZone = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time");
var localTime = TimeZoneInfo.ConvertTime(serverTime, serverZone, localZone);
// => 09-Mar-2014 11:30:00 PM