Reputation: 215
My token expire time value(currentUser.expire)
is '2018-08-01T17:29:17+01:00'
I want to compare the current time.
currentUser.expire > new Date().valueOf()
new Date().valueOf()
is '1533110765293'
The format of the two values is different.
What is the most appropriate method?
Upvotes: 1
Views: 540
Reputation: 839
if (new Date('2018-08-01T17:29:17+01:00') > new Date()) {
// do something
}
Upvotes: 3