Reputation: 1775
can i get help coverting this string to date format.
Here is the JSon name and value
notBefore: 1413936000000
notAfter: 1479427199000
I believe this needs to be converted to US format date mm/dd/yyyy
The callback string looks like this:
response.endpoints[0].details.cert.notBefore
response.endpoints[0].details.cert.notAfter
Upvotes: 0
Views: 61
Reputation: 16979
Just go ahead and craft up a new Date
new Date(notBefore)
If your values are indeed strings, you can parseInt()
them
If you need a simple example for mm/dd/yyyy format, here is a working fiddle to get you up and running.
var notBefore = 1413936000000;
var date = new Date(notBefore);
var formattedDate = (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear();
Upvotes: 3