View Full Version : date problems

01-28-2007, 02:03 PM
hye... i have a problem here. try to keep this simple.

i got a database file that was exported by a software (dont remember) and it got the document date column. the problem is the date that was exported was not in any format that i know. instead of 10/10/06 or any known format, it displayed 1061010.

the first number that is 1, didnt have anything to do with date. it just some thing that the software did to i dont know what.

it should be 061010 rite? how to "translate" that into a proper format? let say 10/10/06

i need the date to make the system works. can someone help me?

thanks in advance!

01-28-2007, 03:44 PM
The format is fine, no corruption or anything. Basically you want to use php's date() function to take that timestamp and reformat it to your needs.

http://php.net/date will tell you everything you need to know. Read the user comments too.

An example using the stamp you mentioned would be:

$dstamp = '1061010';
$frmt_date = date('m/d/y', $dstamp);
echo $frmt_date;

01-28-2007, 04:47 PM
still cant work that out... can anyone give me details of this?

the data in date column in the database that i have all start with number 1xxxxxx...

that means if the date was 29/12/2006.... it will display 1061229... its like 1ymd or something....

i try using above code ... but it return 70/01/01... that means 1st jan 1970 rite?

can some one help me how to display the date in more sensible manner?

newbies needed help here... :D