Hi again to all,

Can anyone know how to do this?

<?php

 // 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.

Recommended Answers

All 3 Replies

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");

thanks for the help guys

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.