When i display my system date using DateTime.Now()
function It gives me system date and time and works fine but when i try to run this page on my server
it gives me the DateTime of Server which is outside India But i want to pick up the time of India whenever this page is executed on server.
I know it is possible through Culture Info
Class... Any suggestion....
Indian Standard Time is calculated from the clock tower in Mirzapur nearly exactly on the reference longitude of IST at 82°30'E, within 4 angular minutes. In 1905, the meridian passing east of Allahabad was declared as a standard time zone for British India and was declared as IST in 1947 for the dominion of India.
It is 14:24:57 right now.
Currently observing IST – India Standard Time. Currently has same time zone offset as IST (UTC +5:30) but different time zone name. India Standard Time (IST) is 5:30 hours ahead of Coordinated Universal Time (UTC). This time zone is in use during standard time in: Asia.
-In India, the longitude of 82° E meridian is regarded as the standard time for the whole country and is known as the Indian Standard Time (IST). -Indian Standard Time which passes through Mirzapur, in Uttar Pradesh is calculated on the basis of 82°30'E longitude.
Put:
private static TimeZoneInfo INDIAN_ZONE = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time");
as a field.
Then, use:
DateTime indianTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, INDIAN_ZONE);
to get the time as needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With