I'm having trouble storing time in database due to the current datetime which is out dated. How can i programatically change the date and time of the system so that the values stored should be correct even if the system date and time is not correct. I've used timezone but it didn't help as it gets the same time and date which is set on the system.
var euTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Pakistan Standard Time");
DateTime euTime = TimeZoneInfo.ConvertTime(System.DateTime.Now, TimeZoneInfo.Local, euTimeZone);
TimeSpan timeOfDay = euTime.TimeOfDay;