Get Indian Date Time on US Server or other foreign servers in asp.net & C#

Category > ASP.NET || Published on : Tuesday, September 22, 2020 || Views: 1232 || Get current date time convert it into local time in c#


Here Pawan Kumar will explain how to Get current date time from server and convert it into local time in c#

Code Snippets

TimeZoneInfo INDIAN_ZONE = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time");
DateTime indianTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, INDIAN_ZONE);

Get the datetime

indianTime.ToString()