1

Hello PHP DEV, I Want to know why this strange thing is happening! Example : strtotime("+1 days") returns time as UTC TIME which is current Time so why strtotime('tomorrow') returns time as 00:00:00.

I noticed this show wants to know the official reason behind this.

thisaakash
  • 13
  • 3

1 Answers1

0

strtotime("+1 days") uses current time and adds a day

strtotime('tomorrow') returns tomorrow at midnight (this is stated in the docs)

datetime formats

'yesterday' Midnight of yesterday "yesterday 14:00" 'midnight' The time is set to 00:00:00
'today' The time is set to 00:00:00
'now' Now - this is simply ignored
'noon' The time is set to 12:00:00 "yesterday noon" 'tomorrow' Midnight of tomorrow

Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41