This was also my question before, I have easily overcome this by using the Moment.js.
It is easy to use and very understandable. Also, you can easily convert the patterns all together very simply.
Documentation on Moment.js
I don't know if your project is HTML and Javascript (or you are using node or ...), you can simply download (or install the package) the Moment.js and after including it in your project, the only thing you need to do is:
var bDate = "1997-03-23T08:00Z"
var newBDate = moment(bDate, "YYYY-MM-DDTHH:mm[Z]").format('M/DD/YYYY');
//Or you can use any other final date format as you want
console.log(newBDate)
This will help users to easily convert to any time format they want.
Math.floor(bDateformat / 31557600)Dateconstructor understands the formatYYYY-MM-DDas well, so just cut off theT08:00Zpart from your input date ...? (It would understand the full1997-03-23T08:00Zas well, but if you are passing in a specific time as well, your result in seconds will of course slightly differ.)var bDate = "3/23/1997";-> Read What are valid Date Time Strings in JavaScript?