Forum Moderators: coopster

Message Too Old, No Replies

Convert Date Number

         

askeli

10:11 am on Apr 19, 2008 (gmt 0)

10+ Year Member



Hi, im getting a headache trying to figure out how to convert a date which is stored as one number as it has no spaces.

Can someone please point me to a simple way to convert

example: 200804019 to 19th April 2008

Many Thanks

Little_G

11:25 am on Apr 19, 2008 (gmt 0)

10+ Year Member



Here's an example:
<?php
$original = '200804019';
$timestamp = mktime(0,0,0, substr($original, 4, 2), substr($original, 6), substr($original, 0, 4));
echo date('jS F Y', $timestamp);
?>

Andrew

askeli

3:11 pm on Apr 19, 2008 (gmt 0)

10+ Year Member



excellent many thanks