Click here to Skip to main content
15,910,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?
Posted
Updated 22-Jul-18 18:24pm
Comments
Graeme_Grant 22-Jul-18 22:29pm    
Have you looked at Newtonsoft?

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
 
Share this answer
 
Comments
Richard Deeming 23-Jul-18 12:09pm    
Please don't post unrelated links in your answers - it looks like spam.
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
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900