date comparisons

Codes here !

Moderators: egami, macek, gesf

Post Reply
User avatar
Joan Garnet
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Sun Jan 05, 2003 10:27 am

You can use this to compare two dates and act as you want -->

Code: Select all

echo ( strtotime ("22 September 2006") - strtotime ("now") );

strtotime gives you the number of seconds since January 1 1970 00:00:00 GMT (UNIX Epoch)

As you see it gives you the difference between these two dates, so you can compare them using an if, and if the value is less than 0, it means the period expired.


Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests