1

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?

Alfie
  • 1,903
  • 4
  • 21
  • 32
fly high
  • 215
  • 1
  • 4
  • 18

1 Answers1

3
if (new Date('2018-08-01T17:29:17+01:00') > new Date()) {
    // do something
}
xcatliu
  • 791
  • 7
  • 19