Jump to content

time


pagegen

Recommended Posts

date will work with seconds so your be better off spliting ie

$date  = "1057";
$newdate= preg_replace('/(\d\d)(\d\d)/im', '\1:\2', $date);
echo $newdate;

using a regex is overkill

so substr would also work well

$date = "1057";
echo substr($date, 0, 2).":".substr($date, 2, 2);

Link to comment
https://forums.phpfreaks.com/topic/210307-time/#findComment-1097432
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.