Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Albertiss's avatar

Add a period(number of days) to qtrtotime date format

I have a date with strtotime format 1647436285 and a period of days with this format and value P1D, i want to add this period to this date

0 likes
1 reply
sr57's avatar

a period of days with this format and value

don't understand

1647436285 is just seconds, you can add a period in seconds and see date

date('Y-m-d',1647436285+2*86400)
=> "2022-03-18"

Please or to participate in this conversation.