Welcome to WebmasterWorld Guest from 35.171.45.91

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Convert Date Number

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

Junior Member

10+ Year Member

joined:Nov 29, 2003
posts: 94
votes: 0


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

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

Preferred Member

10+ Year Member

joined:Feb 11, 2006
posts:481
votes: 0


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

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

Junior Member

10+ Year Member

joined:Nov 29, 2003
posts: 94
votes: 0


excellent many thanks