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=jsonI'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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login