B
B
bpGusar2019-10-15 16:43:59
JavaScript
bpGusar, 2019-10-15 16:43:59

How to subtract 3 days from today's date and compare with the conditional date, and if there are 3 days left before the conditional date, then issue a message?

How to subtract 3 days from today's date and compare with the conditional date, and if there are 3 days left before the conditional date, then issue a message?
Maybe I asked a stupid question.
Here is a case:
there is a conditional date in the following format 2019-11-14T09:07:02.376+00:00
you need to make a function that will see that today there are 3 days left before the conditional date and issue a message if it is

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2019-10-15
@bpGusar

If it suits "less than three days left", then:

(new Date('2019-11-14T09:07:02.376+00:00') - new Date()) < 3 * 24 * 60 * 60 * 1000

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question