Click here to Skip to main content
16,020,261 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have hosted my application in India with shared hosting and our client using it from Ireland. I want to set my application default time zone to same as of Ireland. How could I do this?
I am new to this topic.
Please suggest on this.

Thanks
Posted

set the culture info as US format

IFormatProvider theCultureInfo = new System.Globalization.CultureInfo("en-US", true);
 
Share this answer
 
Comments
[no name] 3-Apr-14 4:29am    
If I use the second solution it means that I need to update each and every page in my application.
Is there any solution rather than this.
You will need to set the culture at application level. You can do that in web.config file in globalization node. For more details on how to do it, please refer this article - HOW TO: Set Culture Information in an ASP.NET Application Without Code[^].

Hope that helps!
 
Share this answer
 
Comments
[no name] 3-Apr-14 4:32am    
Thanks Ankur.

I have tried with Web config option. Not working. When client place order from Ireland there is time mismatch and the order is placed by next day date.
Ankur\m/ 3-Apr-14 4:48am    
So you have voted the answer down. Great!
Where are you recording the time? Are you passing it from your application or are you doing it in the database proc?
[no name] 3-Apr-14 5:00am    
At application level.
Ankur\m/ 4-Apr-14 2:09am    
Then it must get culture specific time. There is something wrong in your code. Try to log the time that you are sending. Also log the culture specific value.
The best practice is to save the date time in UTC and convert it to specific culture while displaying. Google for keywords like 'saving date time different culture design' to read more about it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900