search

Home  >  Q&A  >  body text

javascript - How to determine continuous check-ins based on the last check-in time

Try current time - last check-in time > 60×60×24.
This method always breaks the signature.
So if the last check-in was at 0:00 on the 1st, today is at 23:59 on the 2nd

ringa_leeringa_lee2769 days ago915

reply all(4)I'll reply

  • 天蓬老师

    天蓬老师2017-06-05 11:12:16

    When calculating, why not just use the 0-point timestamp for calculation, (strtotime(date('Y-m-d',$time1))-strtotime(date('Y-m-d',$time2)))/(3600 *twenty four).
    There is no need to do this. Each person has one record, user ID, last check-in date, and consecutive check-in dates. Determine whether there are several days between today and the last check-in date. If it is the next day, the continuous check-in date +1. If there are several days apart, Day, it will directly become 1.

    reply
    0
  • ringa_lee

    ringa_lee2017-06-05 11:12:16

    How about comparing the dates directly...

    Although when I sign in now, it is considered a successful sign-in 18-32 hours after the last time. .

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-06-05 11:12:16

    You definitely cannot use the time seconds to confirm. For example, if your previous time was 2017-5-30, I can get the second day's time 20170531 through the date() function. Then get and set the day's time format Ymd. Determine whether two are equal

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-06-05 11:12:16

    where date(new_date)-date(old_date)=1;

    reply
    0
  • Cancelreply