Skip to content
Advertisement

Check if date is less than 1 hour ago?

Is there a way to check if a date is less than 1 hour ago like this?

JavaScript

Also, different question – is there a way to add hours to a date like this?

JavaScript

Advertisement

Answer

Define

JavaScript

then you can do

JavaScript

To get one hour from a date, try

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement