Timestamp: Difference between revisions
Content deleted Content added
converting wikimedia timestamp |
m adding H:m:s |
||
Line 5: | Line 5: | ||
$month = substr($timestamp, 4, 2); |
$month = substr($timestamp, 4, 2); |
||
$day = substr($timestamp, 6, 2); |
$day = substr($timestamp, 6, 2); |
||
$ |
$hour = substr($rctimestamp, 8, 2); |
||
$minute = substr($rcstimestamp, 10, 2); |
|||
$second = substr($rctimestamp, 12, 2); |
|||
$date = date('M d, Y H:m:s', mktime($hour, $minute, $second, $month, $day, $year)); |
|||
?> |
?> |
||
Revision as of 00:22, 1 March 2005
This is useful for converting Wikimedia timestamps (yyyymmddhhmmss) to human readable format.
<?php
$year = substr($timestamp, 0, 4); $month = substr($timestamp, 4, 2); $day = substr($timestamp, 6, 2); $hour = substr($rctimestamp, 8, 2); $minute = substr($rcstimestamp, 10, 2); $second = substr($rctimestamp, 12, 2); $date = date('M d, Y H:m:s', mktime($hour, $minute, $second, $month, $day, $year));
?>