gpt4 book ai didi

c# - 如何在没有\/Date的情况下格式化JSON日期?

转载 作者:太空宇宙 更新时间:2023-11-03 16:18:30 24 4
gpt4 key购买 nike

<分区>

我需要使用以下格式的 JSON 日期格式:docDate":"1360905419116",","inDocDate":"1360905419116", etc.

我的连载:

JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
string result = jsonSerializer.Serialize( new {
docDate = DateTime.Now,
inDocDate = DateTime.Now,
outDocDate = DateTime.Now } );

序列化后得到的结果:

{"docDate":"\/Date(1360905419116)\/","inDocDate":"\/Date(1360905419116)\/","outDocDate":"\/Date(1360905419116)\/"}

我想拥有

{"docDate":"1360905419116","inDocDate":"1360905419116","outDocDate":"1360905419116"}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com