date math

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • laredotornado@zipmail.com

    date math

    Hi,

    I'm using PHP 4.4.4. If I have a date of the form

    $curDate = date("Y-m-d");

    How do I get the date 6 months from this date?

    Thanks, - Dave

  • Kim André Akerø

    #2
    Re: date math

    laredotornado@z ipmail.com wrote:
    Hi,
    >
    I'm using PHP 4.4.4. If I have a date of the form
    >
    $curDate = date("Y-m-d");
    >
    How do I get the date 6 months from this date?
    >
    Thanks, - Dave
    You might try:
    $oldDate = date("Y-m-d", strtotime("6 months ago"));

    --
    Kim André Akerø
    - kimandre@NOSPAM betadome.com
    (remove NOSPAM to contact me directly)

    Comment

    Working...