hyperdrive hyperdrive - 2 months ago 20
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

You do it easy with str_replace:

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

Hope this helps