Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Dates returned by NugetV2 API in JSON
-
Hi,
On calling
myprogetserver/nuget/feed/Packages()&$format=json
I'm getting back some really weird dates, e.g.
/Date(636650168208570000+0)/
This should evaluate to 19 Jun 2018 2:53:40 PM
Is this a bug? If not, how do you convert this value back to a real datetime?Product: ProGet
Version: 4.7.1
-
This is actually an artifact of the OData specification from when ProGet was first developed - that was actually the preferred format specified, and NuGet.org didn't support $format=json, so we just followed the OData spec.
Anyway, those are just .NET DateTime Ticks in there (and the +0 just indicates UTC), so in your example it would just be:
new DateTime(636650168208570000, DateTimeKind.Utc)
Of course, if we had it to do over again, it would be something more sensible like ISO-8601.