The Date
object has the valueOf
method which returns the number of milliseconds since midnight 1970-01-01. You can use it to compare dates. Something like
var date01 = new Date();
var date02 = new Date(2012, 5, 24);
if (date01.valueOf() > date02.valueOf()) {
....
}
Related Contents:
- `uuuu` versus `yyyy` in `DateTimeFormatter` formatting pattern codes in Java?
- Simplest way to increment a date in PHP?
- Google Apps Script date format issue (Utilities.formatDate)
- Get today date in Google Apps Script
- How can I parse / create a date time stamp formatted with fractional seconds UTC timezone (ISO 8601, RFC 3339) in Swift?
- What are valid Date Time Strings in JavaScript?
- How to prevent ifelse() from turning Date objects into numeric objects
- How to calculate number of days between two given dates
- How do you display JavaScript datetime in 12 hour AM/PM format?
- How to convert java.util.Date to java.sql.Date?
- Is java.sql.Timestamp timezone specific?
- MySQL Query GROUP BY day / month / year
- Why does the month argument range from 0 to 11 in JavaScript’s Date constructor?
- Browsers, time zones, Chrome 67 Error (historic timezone changes)
- Creating a range of dates in Python
- Java 8: Difference between two LocalDateTime in multiple units
- Error in MySQL when setting default value for DATE or DATETIME
- Best way to store date/time in mongodb
- How to parse a time into a Date object from user input in JavaScript?
- group by dates in mongodb
- Split date-time column into Date and time variables
- Javascript format date / time [duplicate]
- Calendar returns date in wrong time zone
- How to list all months between two dates
- efficiently generate a random sample of times and dates between two dates
- AngularJS – convert dates in controller
- How to select date from datetime column?
- Java: Convert String to TimeStamp
- How to get the first date and last date of the previous month? (Java)
- How to JSON stringify a javascript Date and preserve timezone
- Date conversion and culture: Difference between DATE and DATETIME
- What is the use of “lenient “?
- Check if string has date, any format
- Zero-based month numbering [closed]
- Get yesterday’s date using Date [duplicate]
- MySQL – select data from database between two dates
- Find Month difference in php? [duplicate]
- How do you do date math that ignores the year?
- mysql: get record count between two date-time
- Date does not display from Model on HTML input type date
- A type for Date only in C# – why is there no Date type?
- Convert string to datetime
- Date in a URL dd/mm/yyyy
- Why isn’t “2016-02-16” equal to “2016-02-16 00:00”?
- Datetime in C# add days
- Python: How to convert datetime format? [duplicate]
- Comparing dates stored as varchar
- Random date in C#
- Calculate total seconds in PHP DateInterval
- How do you explain the result for a new \DateTime(‘0000-00-00 00:00:00’)?