在json接收日期 [英] Receive date in json

查看:115
本文介绍了在json接收日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以txt格式保存日期(在自动下载日期之后 - 自动)。我必须使用json(c#)。

请问,有人可以给我一些提示吗?



我尝试过:



我在c#中试过,但我不知道如何用json写?

I want to save date in txt format(after download date from web -automatically). I have to use json (c#).
Please, could somebody give me some tips?

What I have tried:

I tried in c# but I don't know how to write in json?

推荐答案

要从API获取日期,请使用http://www.convert-unix-time.com/api?timestamp=86401。



此api使用JSON ,你可以在这里试试,检查这里的JSON数据是从在线API中获取的。



https://jsonformatter.org/?url=http://www.convert-unix-time.com/api?timestamp = 86401 [ ^ ]。



使用C#的JSON解析器来解析JSON并将该字符串存储到Text。



谢谢,

虹膜。

https:/ /hexcolorcodes.org
To get date from API, using http://www.convert-unix-time.com/api?timestamp=86401.

This api uses JSON, you can try that here, Check JSON data here which is fetch from the online API.

https://jsonformatter.org/?url=http://www.convert-unix-time.com/api?timestamp=86401[^].

Use JSON Parser of C# to parse the JSON and store that string to Text.

Thanks,
Iris.
https://hexcolorcodes.org


如果你想将日期从.net转换为json 格式,试试这个

。净日期格式与json.so不同,您需要在发送之前转换.net日期格式。



[可序列化]

系统.DateTime netdate = System.DateTime.Today;



System.DateTime jsdate = new System.DateTime(,,);

写下c#中的代码转换日期并在json formt中返回日期,并在json中调用这些函数来获取日期
if you want to convert the date from .net to json format try this
.net date format is different from json.so ,you need to convert the .net date format before sending .

[serializable]
System.DateTime netdate = System.DateTime.Today;

System.DateTime jsdate = new System.DateTime(,,);
write the code in c# to convert date and return the date in json formt ,and call these function in json to get the date


这篇关于在json接收日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆