hyperdrive hyperdrive - 1 year ago 93
PHP Question

PHP time format, am and pm with periods

How could I adjust the php time format to a.m and p.m with the periods included?

date('h:i a');

Answer Source

You do it easy with str_replace:

str_replace(array('am','pm'),array('a.m','p.m'),date('h:i a'));

Hope this helps

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download