IrfanRaza
IrfanRaza

Reputation: 3058

Getting date-time in locale format in asp.net

I have a web application developed in asp.net 3.5. The application is used in India only while it is hosted on US servers. The problem here is that i want to show the date and time according to India timezone. When i am using DateTime.Now.ToString() i am getting the date and time of server with US format i.e. MM/dd/yyyy hh:mm:ss tt. What i want is the date and time according to India i.e. dd/MM/yyyy hh:mm:ss tt.

I know that i can use custom formatting for date but the problem is with time. How can i convert server time (US) to local time (India). I know javascript can be used to get local time, but what about the correctness of time?. Because local time may differ from actual time.

Can anybody help me for getting correct time according to India?

Thanks for sharing your time.

Upvotes: 1

Views: 3669

Answers (1)

Mitch Wheat
Mitch Wheat

Reputation: 300837

Please see: how to convert server time to local time

Upvotes: 2

Related Questions