Jump to content

How do I convert dates between formats


pioneerx01

Recommended Posts

Here's a bit of a start to help you out. This will split the string into it's components

 

<?php

$date_str = '20120813005549';

list( $year1, $year2, $month, $day, $hour, $min, $sec ) = str_split($date_str, 2);
$year = $year1.$year2;

echo "$year - $month - $day $hour:$min:$sec";

?>

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.