Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,

I have a problem regarding DateTime Time Zone change on my client WPF application.


The situations are like this,

1) I have Server on US. Both Database and ApplicationServer is on the system.
2) I have Client application is in India.


Problem,

As server and client both are at different places The TimeZones are also differs. Problem is that when client see the record with date '20-May-2012' is actually '19-May-2012' in database server.

The application is 3 Layer Application View - Service - Database.
Here Service and Database is on US server. I am getting DataTable from service side.
Please let me know what kind of changes i need to Done.
Posted

I refer to you the response[^] I gave some time ago :)

Pay particular attention to item 1
 
Share this answer
 
I am not sure but you can use Globalization.

C#
using System.Globalization;

CultureInfo ci=new CultureInfo("gu-IN")
Datetime dt= DateTime.Parse(TextBox1.Text.ToString(),ci);


Let me know if it works.
Thanks
Ashish
 
Share this answer
 
Comments
milannaughty 9-Aug-12 11:26am    
Thank you for your response. I have to Sync my server's and clients' timezones.
Is there any way to resolve this?

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