Click here to Skip to main content
11,504,472 members (74,691 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.5 DateTime
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 7-Aug-12 22:43pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

Pay particular attention to item 1
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I am not sure but you can use Globalization.

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
  Permalink  
Comments
milannaughty at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 223
1 OriginalGriff 220
2 CHill60 200
3 Peter Leow 170
4 F-ES Sitecore 140
0 Sergey Alexandrovich Kryukov 673
1 Maciej Los 455
2 DamithSL 435
3 Peter Leow 430
4 OriginalGriff 417


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 8 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100