B
Burton Roberts
When I insert a date value through my winforms smart client to a WCF Web
service in a different time zone to SQL Server, the date recorded in SQL is
adjusted by the time zone. I'm in the Eastern Time Zone, my web server is
in the Central Time Zone. I create a datetime value by using a date picker
control which gives me an eastern datetime Dec 10, 2008 12:00 AM midnight.
I submit it to the WCF webservice and SQL Server gets it as Dec 9, 2008
11:00 PM. The field type is the new SQL Server 2008 Date type, so I'm not
even interested in the time part of the data. SQL Server truncates the time
for the date and Dec 9 gets stored instead of Dec 10.
Since all my workstations happen are in the Eastern Time zone I just
programatically add 61 minutes to the date before its submitted so that the
correct date is stored in SQL. That seems like a miserable hack, though,
and wonder if there's a more elegant solution.
Thanks
service in a different time zone to SQL Server, the date recorded in SQL is
adjusted by the time zone. I'm in the Eastern Time Zone, my web server is
in the Central Time Zone. I create a datetime value by using a date picker
control which gives me an eastern datetime Dec 10, 2008 12:00 AM midnight.
I submit it to the WCF webservice and SQL Server gets it as Dec 9, 2008
11:00 PM. The field type is the new SQL Server 2008 Date type, so I'm not
even interested in the time part of the data. SQL Server truncates the time
for the date and Dec 9 gets stored instead of Dec 10.
Since all my workstations happen are in the Eastern Time zone I just
programatically add 61 minutes to the date before its submitted so that the
correct date is stored in SQL. That seems like a miserable hack, though,
and wonder if there's a more elegant solution.
Thanks