date

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

    date

    Hi,

    I retrieve a date from the mysql database.

    e.g 2004/12/02

    How is it possible to make this day with 1 day higher : so I get 2004/12/03?

    Thx,

    Alain


  • Ben Gribaudo

    #2
    Re: date

    Hi Alain,
    [color=blue][color=green]
    > > How is it possible to make this day with 1 day higher : so I get[/color][/color]
    2004/12/03?

    Try this:
    SELECT DATE_ADD(date_c olumn_name, INTERVAL 1 DAY) FROM table_name


    Have a great day!
    Ben :-)
    Ben Gribaudo - Baltimore, MD - www.bengribaudo.com

    "For God so loved the world, that he gave his only begotten Son, that
    whosoever believeth in him should not perish, but have everlasting life."
    John 3:16

    "Alain Dhaene" <alain.dhaene@w orldonline.be> wrote...[color=blue]
    > Hi,
    >
    > I retrieve a date from the mysql database.
    >
    > e.g 2004/12/02
    >
    > How is it possible to make this day with 1 day higher : so I get[/color]
    2004/12/03?[color=blue]
    >
    > Thx,
    >
    > Alain
    >
    >[/color]


    Comment

    • Kelv

      #3
      Re: date

      Alain Dhaene wrote:
      [color=blue]
      > I retrieve a date from the mysql database.
      >
      > e.g 2004/12/02
      >
      > How is it possible to make this day with 1 day higher : so I get 2004/12/03?[/color]

      If the dates are in datetime format you can manipulate them in all sorts
      of ways. PHP is pretty flexible in date interpretation too. e.g

      $today="2004/12/02";

      $tomorrow = date("Y:m:d",st rtotime("+1 day",strtotime( $today)));

      Hope that helps,

      Kelv
      --
      LoHost
      LoHost - Reliable low cost web hosting with PHP4 and PHP5, MySQL 4 database, htaccess creator and Zend Optimizer. Secure email hosting with authenticated SMTP, IMAP email hosting, webmail, spam blocker, virus blocker, subdomains and vacation. UK hosting, USA hosting, secure hosting, cart hosting, blog hosting, nightly backups, raid servers and more.

      Comment

      Working...