Jump to content

[SOLVED] Display Time in PHP


npsari

Recommended Posts

Hello everybody

 

I use this to display time

 

$tim = localtime(time(),true);

$Time=($tim['tm_hour'].":".$tim['tm_min'].":".$tim['tm_sec']);

 

 

But when i print $Time i get it like that

4:32:1

 

I want to get it like that

04:32:01

 

Can you please tell me what can i change

Link to comment
https://forums.phpfreaks.com/topic/103377-solved-display-time-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.