php time comparison code example Example: date comparison function in php Select if(Date('2020-10-01') > Date('2020-11-01'), '1', '2' ) as rslt_date