Dear Colleagues. I have the number 300 - this is the number of seconds, respectively, exactly 5 minutes. How can I convert this number to Unix format

1 answer 1

In general, Unix time is measured in seconds and this is a specific time period.

How can I convert this number to Unix format - a little incorrectly asked question - here either the current time is +5 minutes, or the current time is minus 5 minutes, because Unix time is always a specific period of time and with every new second it increases

$a=time()+300;$a=time()-500;//и никак иначе //результат будет в Unix формате 

fixed on:

 $a=time()+300;$a=time()-300; 

If we are talking about storing the values ​​of the time difference - then I usually store in different columns - at one start time, at the other end time, and the format is at your discretion

  • I agree 500 this is an error, it is necessary 300. I know that time is not a format, but if I were a newbie, I would have asked a question. What is your level of training for asking questions? and what should be the answer according to yours? Perhaps here we are talking about how to store the value of the time interval in the database and the question is incorrect, in that case why the question was not minus that is more than incomprehensible to me - Mcile