php - adding two times(time() + seconds) -


I want to add X seconds to the present time


So it should be Current_time () + $ x
and dd-mm-YYYY hh: mm: ss

is formatted as to ?

Better (and less), my method (suggested by):

  $ currentDate = date ('DMYH: I:' ', (time ()); $ Transfered date = date ('D-M-YH: I: S', (time (+ 5922725));   

My answer:

You get the mktime () function and date () Function

Example: $ currentTime = mktime (date ("H"), date ("I"), to get you this work to be colleague Date ("s"), date ("m"), date ("d") + 1, date ("y")); $ ShiftedTime = mktime (date ("h"), date ("i"), date ("s"), + 5922725, date ("m"), date ("d") + 1, date (" )); // Change with

Note that the mktime () function returns the UNIX timestamp as a result, so you convert the actual timelines to the actual date Date: ("M"), Date ("I"), Date ("S"), Date ("M"), Date, Date> Date> "Current Time = Date ('DMI H: I: S ", MKTM (date) (" D ") +1, date (" Y ")); // Similar to transpose.

Source:




Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -