12345678910111213141516171819202122232425262728293031 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.Json.Serialization;
- using System.Text.Json;
- using System.Threading.Tasks;
- namespace OASystem.Domain
- {
- /// <summary>
- /// datetime 返回日期 格式 yyyy-MM-dd
- /// </summary>
- public class DateOnlyConverter : JsonConverter<DateTime>
- {
- public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
- {
- throw new NotImplementedException();
- }
- public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options)
- {
- writer.WriteStringValue(value.ToString("yyyy-MM-dd"));
- }
- }
- }
|