How to create a JSON.NET Date to String custom Converter

后端 未结 2 627
悲哀的现实
悲哀的现实 2020-12-01 16:03

Could someone tell me please how I can create a custom converter

I know I can use JSON.NET ISODateConvertor, but what I want is specific, I just want to send the va

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-01 16:26

    If you are using Web Api add the custom formatter to the configuration using:

    config.Formatters.JsonFormatter.SerializerSettings.Converters.Add(new MyDateTimeConvertor())
    

提交回复
热议问题