Time.....

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

    Time.....

    Hi Guys:

    I am pretty new to this so forgive me it is it a silly question....
    I am setting a 15 minute cookie using time()+900.
    This works but I would like to inform the user of the expiration time in a
    hh:mm format...

    What I need to know is how to convert time()+900 into HH:MM.

    Thanks in advance..

    MP


  • Andy Hassall

    #2
    Re: Time.....

    On Mon, 2 Feb 2004 21:46:43 +0000 (UTC), "Max Power"
    <Max.Power@exce lence.co.uk> wrote:
    [color=blue]
    >What I need to know is how to convert time()+900 into HH:MM.[/color]


    --
    Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
    <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>

    Comment

    • Max Power

      #3
      Re: Time.....

      Thanks for that Andy.

      I did have a look on php.net but only time()....
      We live and learn.....

      Thanks again.

      "Andy Hassall" <andy@andyh.co. uk> wrote in message
      news:t5it10tlik 6iqgqpi11f262pp jfchbu9mo@4ax.c om...[color=blue]
      > On Mon, 2 Feb 2004 21:46:43 +0000 (UTC), "Max Power"
      > <Max.Power@exce lence.co.uk> wrote:
      >[color=green]
      > >What I need to know is how to convert time()+900 into HH:MM.[/color]
      >
      > http://www.php.net/date
      > --
      > Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
      > <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>[/color]


      Comment

      • Philip D Heady

        #4
        Re: Time.....

        $the_time_you_w ant = date("Y-m-d H:i:s",(time+90 0));



        "Andy Hassall" <andy@andyh.co. uk> wrote in message
        news:t5it10tlik 6iqgqpi11f262pp jfchbu9mo@4ax.c om...[color=blue]
        > On Mon, 2 Feb 2004 21:46:43 +0000 (UTC), "Max Power"
        > <Max.Power@exce lence.co.uk> wrote:
        >[color=green]
        > >What I need to know is how to convert time()+900 into HH:MM.[/color]
        >
        > http://www.php.net/date
        > --
        > Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
        > <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>[/color]


        Comment

        • Philip D Heady

          #5
          Re: Time.....

          Sorry, my bad. This will add 15 mins to the time.

          <?

          $i = date("i") + ('15');
          $today = date("H:$i:s");
          echo $today;

          ?>


          "Philip D Heady" <pdheady@comcas t.net> wrote in message
          news:0QzTb.43$H 35.65032@news.u swest.net...[color=blue]
          > $the_time_you_w ant = date("Y-m-d H:i:s",(time+90 0));
          >
          >
          >
          > "Andy Hassall" <andy@andyh.co. uk> wrote in message
          > news:t5it10tlik 6iqgqpi11f262pp jfchbu9mo@4ax.c om...[color=green]
          > > On Mon, 2 Feb 2004 21:46:43 +0000 (UTC), "Max Power"
          > > <Max.Power@exce lence.co.uk> wrote:
          > >[color=darkred]
          > > >What I need to know is how to convert time()+900 into HH:MM.[/color]
          > >
          > > http://www.php.net/date
          > > --
          > > Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
          > > <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>[/color]
          >
          >[/color]


          Comment

          • Andy Hassall

            #6
            Re: Time.....

            On Mon, 2 Feb 2004 17:27:19 -0500, "Philip D Heady" <pdheady@comcas t.net>
            wrote:
            [color=blue]
            >"Philip D Heady" <pdheady@comcas t.net> wrote in message
            >news:0QzTb.43$ H35.65032@news. uswest.net...[color=green]
            >> "Andy Hassall" <andy@andyh.co. uk> wrote in message[color=darkred]
            >>> On Mon, 2 Feb 2004 21:46:43 +0000 (UTC), "Max Power"
            >>>
            >>> >What I need to know is how to convert time()+900 into HH:MM.
            >>>
            >>> http://www.php.net/date[/color][/color][/color]
            [color=blue][color=green]
            >> $the_time_you_w ant = date("Y-m-d H:i:s",(time+90 0));[/color]
            >
            >Sorry, my bad. This will add 15 mins to the time.
            >
            >$i = date("i") + ('15');
            >$today = date("H:$i:s");[/color]

            No it won't, it'll be wrong if it's currently 45 minutes past the hour or
            later. The OP was correct to stick with adding 900 seconds to a Unix timestamp
            and then formatting it afterwardws.

            --
            Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
            <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>

            Comment

            Working...