D
D
driverx182018-02-18 13:23:08
PHP
driverx18, 2018-02-18 13:23:08

Subtract unixtime from unixtime and get date?

You need to subtract the unixtime of another date from the current date. Is the correct algorithm to do this: time() - $dateunix and wrap the result in date()? Or is something else used for this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Bobkov, 2018-02-18
@mike_bma

It is better to do it through DateTime-> diff and format the resulting DateInterval as needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question