Select the date and time to print the wrong date

When I select some data rows from the mssql2005 database and bind them to the datagrid, the dates fetched from the db are not valid. For example, in db, I have a date in the form:

2009-05-10 00: 00: 00.000

but when it is displayed in the data grid it looks like this:

5/9/2009 10:00:00 PM

So it shows 2 hours earlier and then it gets saved to db.

05 is the month :-)

What am I doing wrong?

Db entries added by inserting sql query in Sql Management Studio as these guidelines are for testing purposes only.

I am using silverlight 3.0, ria services can browse, english vs08, polish MS vista home premium.

+1


a source to share


1 answer


Sounds like the timezone question to me. Are you fetching strings directly from the database into your application, or can you get them via a web service from another computer?



As a basic test, try setting Windows timezone + 2 hours forward and then see if the problem goes away.

+1


a source







All Articles