Skip to content

Json serialization format for Datetime #556

@iSazonov

Description

@iSazonov
var a= new DateTime(2019,12,5,1,2,3,44);
a.ToString("O");

// Output: 2019-12-05T01:02:03.0440000

System.Text.Json.JsonSerializer.Serialize(a, typeof(DateTime));

// Output "2019-12-05T01:02:03.044"

Should in second case "O" format be used with "fffffff"?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions