문제

Whenever I update any key in couchdb document, it updates existing all date keys in milliseconds formats.

Example:

created_at: 2013-07-09T09:25:00

to

created_at: /Date(1373354700000)/

do you ever come across this issue?

도움이 되었습니까?

해결책

The reason of this conversion can be find here.

If you're using JavaScriptSerializer then it converts the DateTime object as the format

/Date(ticks)/

But It will not convert DateTime string to ticks.

Whereas, if you're using JsonSerializer then you will find the date and time in correct format no matter of object or string type.

Note: JavaScriptSerializer is too slow in as compared to JsonConvert. You can have performance comparison of different serialization.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top