在我的ASP.NET Web API应用程序中,我有这个模型,其中Dictionary<string,string> Data
有两个string
属性,格式为ISO 8601日期格式,而CreatedDate
和{{1是LastUpdated.Date
:
DateTime
在端点中,这看起来像:
{
"MemberId": "156358985",
"Data": {
"memberId": "22219665",
"fullName": "First Lastname",
"startTime": "2018-05-06T10:00:00.0000000+02:00",
"endTime": "2018-05-06T10:30:00.0000000+02:00",
},
"CreatedDate": "2018-05-02T08:31:56.4846309+02:00",
"LastUpdated": {
"Date": "2018-05-02T08:31:56.4846309+02:00",
"Epoch": 1525249916
}
}
我希望{8}日期格式格式化{
"memberId": "156358985",
"data": {
"memberId": "22219665",
"fullName": "First Lastname",
"startTime": "05/06/2018 10:00:00",
"endTime": "05/06/2018 10:30:00"
},
"createdDate": "2018-05-02T08:31:56.4846309+02:00",
"lastUpdated": {
"date": "2018-05-02T08:31:56.4846309+02:00",
"epoch": 1525249916
}
}
,而不是本地化格式。
那么......如何禁用具有日期格式的字符串的自动格式化?