I have a date stored in localStorage under the variable deadline
(Tue Jul 05 2016 18:15:00 GMT+0100 (BST)
) and I want to find the difference between this date and new Date()
however any function I try to carry out with the locally stored date doesn't seem to work.
For example if I try to carry out: console.log(deadline.getTime())
I get the error: deadline.getTime is not a function
but when I carry out the same function on the new Date()
it works fine despite the syntax of the dates being exactly the same. Can anybody shed some light? Thanks.