Hi again to all,

Can anyone know how to do this?


 // let say the time now is 06:00 PM

 $time = Date('h:i A');
 $time1 = strftime('$time');  // I know it is wrong coz the output of this code is $time only. I just include this for you to have an specific idea ^^

 // now i want to display $time1 as 1800

Thanks in advance for your help.

6 Years
Discussion Span
Last Post by lyrico

This is all in the PHP manual. If you don't have a copy, you need to get one:

If you just wanted the time in 24 hour format, it could be as simple as:

$time1 = date("Hi");

If you need to use strftime for local time, then it would be:

$time1 = strftime("%H%M");

Edited by chrishea: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.