0

I set this at the start of the script :

date_default_timezone_set('Europe/London');
$var = date('h:m:s', mktime());
echo $var;

And it outputs this everytime, the only thing that changes is the seconds. 12:12:32 12:12:45 12:12:10

Any help with this would be great :) thanks, Pablo

1 Answer 1

0

Pablo welcome to Ask Ubuntu! This Stack Exchange is designed for questions specifically about Ubuntu, for questions regarding programming like PHP, I suggest you try over at Stack Overflow in future.

Regardless, you're time format is incorrect.

h refers to the month, since we're in december, it's showing you 12.

Minutes are formatting as i

so $var = date('h:i:s', mktime()); will get you the results you need.

See the official documentation here for further info.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .