I read the following question Creating a DateTime in a specific Time Zone in c# and was able to create a DateTime with TimeZone information. But I need to convert the DateTime to string value based on TimeZone.
E.g. I've set the TimeZone as India Standard Time and created a DateTime, when I tried to convert to string using ToString()
instead of 13/12/2019 4:00:00 PM
, I am getting 12/13/2019 4:00:00 PM
. Since I've set the TimeZone as India Standard Time, I would like to display the date in India Format (dd/mm/yyyy)
rather than mm/dd/yyyy
.
So, how do I format the date based on TimeZone in C#?
Edit: I completely understand that Format and Timezone are different things. But I need to format the DateTime to match user's geography which I can identify using his timezone provided as input.