Categories October Surprise 2024 How do I get the current date in JavaScript? – Stack Overflow Post author By Post date September 5, 2026 new Date()returns the current time, not the current date. The distinction matters if you’re trying to compare it against another date which doesn’t have a time component (ie, is at midnight).