How to quickly compare the size of two dates?

            let time = {
                endDate: "2019-02-23",
                endTime: "17:00:35",
                startDate: "2019-02-23",
                startTime: "17:50:35"
            };
            endDate+endTimestartDate+startTime
            
Jul.10,2022

is stitched into a string format and fixed for direct comparison. There is no need to turn the timestamp.


let time = {
    endDate: "2019-02-23",
    endTime: "17:00:35",
    startDate: "2019-02-23",
    startTime: "17:50:35"
};
// 
+new Date(time.endDate+time.endTime) < +new Date(time.startDate+time.startTime);
// `utils`
// :
export const compareDate = (date1, date2) => {
    return new Date(date1).getTime() >= (new Date(date2).getTime());
};

'2019-02-02 17 false < / false >
string comparison will be compared one by one with the Unicode value
first of all, make sure that the length or format of the two characters are the same: ' 22'>'3' / / false

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ae4a-4eeb4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ae4a-4eeb4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?