evaluate date where > 2 weeks ago

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • monomaniac21

    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

  • Kimmo Laine

    #2
    Re: evaluate date where > 2 weeks ago

    "monomaniac 21" <mcyi2mr3@googl email.comwrote in message
    news:1158061327 .515798.194210@ e63g2000cwd.goo glegroups.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@bhg byrzcv.arg)


    Comment

    Working...