I am working with a string in this format:
var value = "/Date(1454187600000+0300)/"
. From this, I need to extract a date format like 1/30/2016
. Currently, I have the following code snippet:
var value = "/Date(1454187600000+0300)/"; // I need to extract from here.
var nd = new Date(1454187600000); //this is static.
var month = nd.getUTCMonth() + 1; //months ranging from 1-12
var day = nd.getUTCDate();
var year = nd.getUTCFullYear();
newdate = month + "/" + day + "/" + year;
console.log( newdate ); //works fine
However, I am unsure of how to use regular expressions to fetch the numbers from the value
variable. Can anyone provide some guidance on this?