Making a GET request to a private (no public documentation) API returns data in JSON format.

The value im interested in is the date. It returns the date in ASP.NET JSON Date format. Here's what it looks like:

AanmeldDatum: "/Date(1406675114000+0200)/"

There's another variable called AangebodenSindsTekst which means OfferedSinceText and it's value is "8 augustus 2014". So the unknown Date format should get parsed into that specific value.

I've tried this:

require 'time'

foo = Time.strptime('1406675114000+0200', '%N') # => 2014-08-12 13:38:46 +0200
foo = Time.strptime('1406675114000+0200', '%N%z') # => 2014-08-12 14:38:58 +0200

But it simply returns the current time.

I know 100% sure that /Date(1406675114000+0200)/ when parsed, should return the date 2014-07-30.

The question is how do I make sure it does?

Related posts

Recent Viewed