evaluate date where > 2 weeks ago

This is a discussion on evaluate date where > 2 weeks ago within the PHP Language forums, part of the PHP Programming Forums category; hi all i have a date on a php page and i need to check if that date ( in this ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-12-2006
monomaniac21
 
Posts: n/a
Default evaluate date where > 2 weeks ago

hi all i have a date on a php page and i need to check if that date (
in this format : 2006-06-04) is more than 2 weeks ago. How can i do
this most efficiently?

regards

marc

Reply With Quote
  #2 (permalink)  
Old 09-12-2006
Kimmo Laine
 
Posts: n/a
Default Re: evaluate date where > 2 weeks ago

"monomaniac21" <mcyi2mr3@googlemail.com> wrote in message
news:1158061327.515798.194210@e63g2000cwd.googlegr oups.com...
> hi all i have a date on a php page and i need to check if that date (
> in this format : 2006-06-04) is more than 2 weeks ago. How can i do
> this most efficiently?



// This is two weeks ago, as a unix timestamp
$twoweeks = strtotime('-14 days');

// This is your date, as a unix timestamp
$timestamp = strtotime('2006-06-04');

Just add water.

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
spam@outolempi.net || Gedoon-S @ IRCnet || rot13(xvzzb@bhgbyrzcv.arg)


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:41 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0