I have set two bits
one is start and the other is end
format is datepicker
of jquery, so it will be 2018-01-01 format
but now I want to make a comparison
I am using the concept of an e-commerce coupon
, so I need to enter the discount code
so check whether the starting time and ending time of the discount code coincides with today
if today"s time is lower than the start time, it is not available, which means that the discount code expires
suppose that today"s time is higher than the start time and lower than the end time. Then I can use
but the time I send it to the database will be a string (2018-01-01)
so that if I want to do the above comparison
, should I stamp it into time, or is it the best way to put a string date?
I thought that if I switch to a timestamp, how can I match it?
if it is the completion date, assuming that today is 2018-07-25, but the expiration date is 2018-07-26, it can still be used, so how can I compare it up and down? It is not a number, so it is more than less than
recharge:
I found that even if the "end time" didn"t arrive, he was still upset.
"SELECT * FROM `discount`
WHERE
`code` = "{$cart_code}"
AND
`end` <= "".time()."" "