aperfectcircle
Programmer
I can't really think of a good way to explain this so here's my best shot...
Ok...I can compare dates in javascript using > or < when I use Date()...for example:
The problem is that I want to compare a date that is stored in a database to the current date, but it won't work because the variable I get from the database is a string. In other words... is there a way to convert a string (already formatted like a date) to a date?
Thanks
Ok...I can compare dates in javascript using > or < when I use Date()...for example:
Code:
var expiredate = new Date()
expiredate.setTime(expiredate.getTime() + (-90 * 24 * 3600 * 1000))
alert("Expire Date is "+expiredate)
var today = new Date()
alert("Current Date is "+today)
if (expiredate <= today) {
alert("Expire Date is less than Current Date")
}
if (expiredate >= today) {
alert("Expire Date is greater than Current Date")
}
Thanks