Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Invalid Date" error on retrieving DateTime value from SQL Server Compact

I encountered the following problem in a simple project with Breeze + Knockout + WebAPI + SQL Server Compact:

when I add a Breeze entity (with a DateTime ko.observable) and do Manager.SaveChanges() the row is correctly saved into SQL Server Compact, and the DateTime column is in this format: 23/12/2012 19.56.33.

When I subsequently do a Breeze query, I get the row back, but the DateTime value is not recognized:

Invalid Date

The date field is a ko observable so I can't debug the value/format, it's a method!

Before the SaveChanges it's in this format: Sun Dec 23 21:32:05 UTC+0100 2012

After the SaveChanges I find it in the SQL Server Compact table in this format: 23/12/2012 20.32.05

perhaps Breeze expects it also in UTC..?

Any help is greatly appreciated!

Thanks

EDIT:

here is the json returned from WebApi BreezeController:

[
   {
      "$id":"1",
      "$type":"MvcTask.Models.Task, MvcTask",
      "id":110,
      "text":"aaa",
      "done":false,
      "created":"2012-12-23T19.56.33.950"
   }
]
like image 971
frenchfaso Avatar asked Jun 19 '26 07:06

frenchfaso


1 Answers

There was a problem with this with earlier versions of breeze but it should be fixed in later versions. Can you try the current version v.80.1?

like image 166
Jay Traband Avatar answered Jun 22 '26 12:06

Jay Traband