Check if date is today
Question:
How to check if date is today? Answer:
new Date().toDateString() === testDate.toDateString()
Description:
If you want to check if a given Date is today then simply use the toDateString()
method. The toDateString()
method returns the date portion of a Date object
Reference:
toDateString reference
Share "How to check if date is today?"
Related snippets:
Tags:
javascript date today, check if date is today Technical term:
Check if date is today