Appendix +1 to microtime date PHP



  • There's a script that counts microtime.

    $date = date_create_from_format('U.u', microtime(true));
    echo date_format($date, 'Y-m-d H:i:s.u');
    

    I've been looking for a long time in the manuale, and that's what I found.

    May be added by month/day/year, etc. +1

        $nextyear  = mktime(date("m"),   date("d"),   date("Y")+1);
        echo date('m d y', $nextyear);            //приводим время в читаемую форму
    

    We need to do this with microseconds. I already did.

     $nextyear  = mktime(date_format($date , "u")+1);
     echo date('u', $nextyear);                        //безуспешно
    

    $nextyear = mktime(date_format($date , "u")+1);
    echo date_format($date, 'u', $nextyear); //тоже безуспешно

    As long as all the unsuccessful attempts are made, who's been confronted and solved like this already?



  • Try to use the pros... If I understood you correctly, there are examples:

    $i = 5; // 5
    

    $i++; // 6

    $k = 3; // 3

    $k = $k+1; // 4

    echo $i; // вывод 6

    echo $k; // вывод 4


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2