Forum Moderators: coopster

Message Too Old, No Replies

negative number in strtotime

         

Simone100

3:32 am on Jul 18, 2007 (gmt 0)

10+ Year Member



hello what does a negative number in strtotime mean? I looked in the manual, couldn't figure it out.

strtotime('-1 month')

Thanks, Simone.

[edited by: Simone100 at 3:35 am (utc) on July 18, 2007]

StudioKraft

3:50 am on Jul 18, 2007 (gmt 0)

10+ Year Member



Hello,

The example that you give would return the Unix timestamp for a date one month prior to the current date. I believe that the code:

strototime("One month ago")

would be equivalent to the code that you posted.

Habtom

5:43 am on Jul 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



strtotime('-1 month');

is equivalent to:

strtotime("last month");

Habtom

Simone100

7:09 am on Jul 18, 2007 (gmt 0)

10+ Year Member



Thanks both of you***