Skip to content
Advertisement

Checking if two Dates have the same date info

How can I check if two different date objects have the same date information(having same day, month, year …)? I have tried “==”, “===” and .equals but none seems to work.

Advertisement

Answer

You can use valueOf() or getTime():

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