date question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yang Li Ke

    date question

    Hi guys,

    I use this function to create a date value:
    $next = mktime(date("H" ), date("i")+60, date("s"), date("m") , date("d"),
    date("Y"));

    How can I display this date like date("Y/m/d, H:i:s"); ?

    Thank you!

    --
    Yang


  • Tom Thackrey

    #2
    Re: date question


    On 6-Feb-2004, "Yang Li Ke" <yanglike@sympa tico.ca> wrote:
    [color=blue]
    > I use this function to create a date value:
    > $next = mktime(date("H" ), date("i")+60, date("s"), date("m") , date("d"),
    > date("Y"));
    >
    > How can I display this date like date("Y/m/d, H:i:s"); ?[/color]

    echo date("Y/m/d, H:i:s",$next);

    --
    Tom Thackrey

    tom (at) creative (dash) light (dot) com
    do NOT send email to jamesbutler@wil lglen.net (it's reserved for spammers)

    Comment

    • rostik

      #3
      Re: date question

      "Yang Li Ke" <yanglike@sympa tico.ca> wrote in message
      news:MFXUb.2442 9$bp1.770639@ne ws20.bellglobal .com...[color=blue]
      > $next = mktime(date("H" ), date("i")+60, date("s"), date("m") , date("d"),
      > date("Y"));
      >
      > How can I display this date like date("Y/m/d, H:i:s"); ?
      >[/color]

      Your function is really amazing! :)
      Try:

      $next = time()+3600;
      echo date("Y/m/d, H:i:s",$next);


      Comment

      • Geoff Berrow

        #4
        Re: date question

        I noticed that Message-ID: <c020pc$2qnl$1@ news.ntu-kpi.kiev.ua> from
        rostik contained the following:
        [color=blue]
        >Your function is really amazing! :)
        >Try:
        >
        >$next = time()+3600;
        >echo date("Y/m/d, H:i:s",$next);[/color]

        or even

        $next = strtotime("+1 hour");
        echo date("Y/m/d, H:i:s",$next);

        --
        Geoff Berrow (put thecat out to email)
        It's only Usenet, no one dies.
        My opinions, not the committee's, mine.
        Simple RFDs http://www.ckdog.co.uk/rfdmaker/

        Comment

        Working...