13

Was googling this, but couldn't find the answer. Was wondering, if there is a difference in these two scripts?

+3 day:

echo date( 'd.m.Y H:i:s', strtotime( '+3 day' ) );

+3 days:

echo date( 'd.m.Y H:i:s', strtotime( '+3 days' ) );

The output is exactly the same.

So is that implemented to make sure people get less errors or what?
And witch one should be preferred to use?

Peon
  • 7,902
  • 7
  • 59
  • 100

1 Answers1

23

That is basically same thing, and for usability and pretty purposes:

strtotime( '+1 day' );
strtotime( '+3 day' );
strtotime( '+1 days' );
strtotime( '+3 days' );
strtotime( '+1 weeks' );
strtotime( '+3 week' );

You can use the one you like more, basically the one that defines de number, 1 day, 3 days

Mihai Iorga
  • 39,330
  • 16
  • 106
  • 107