I am doing quite a few queries within PHP. I am displaying information from these queries but I would like to change the date format to something that people other than programmers can easily read. Currently I have been able to get by by using this:
$compdt = str_split($fin47['COMPDT']);
$compdt = "$compdt[3]$compdt[4]/$compdt[5]$compdt[6]/$compdt[1]$compdt[2]"
The above works great. For example, from the database, I return this for the date:
1090225
After I do my array and string arrangement, I get this:
02/25/09
But when I have a pre 2000 date returned from the database like this:
960614
I get this after my string arrangement:
61/4/60
Which is obviously incorrect because the century number is not there and also the zero for the year.
I just ran in to some dates that were pre 2000 in year and all of the formatting is off. Is there any easy way to flip the date around or will I have to have a second array arrangement for dates that are pre 2000?