Forum Moderators: coopster

Message Too Old, No Replies

Time Code

         

branmh

12:53 pm on Aug 14, 2003 (gmt 0)

10+ Year Member



How could I remove the (:mm A¦PM) which leaves just (h) and also another code to convert that over to a 24 hr format, instead of 12 hr?

Paul in South Africa

1:29 pm on Aug 14, 2003 (gmt 0)

10+ Year Member



print date("H", time());

will return hours in 24 hour format with leading zeros.

If you want it with no leading zeros substitute "G" for "H"

branmh

8:56 pm on Aug 14, 2003 (gmt 0)

10+ Year Member



I'm using a varible that outputs 5:00 PM, from that I would like to remove the :mm A¦PM...

jonknee

9:01 pm on Aug 14, 2003 (gmt 0)

10+ Year Member



strtotime() will take about any time format and convert it to a unix time stamp. So try something like:

$new_time = date("OPTIONS", strtotime($old_date));