I am importing Excel into Data Base. I enter in Excel is 9-Oct-2006.I want to get the excel to
php file but i am not getting.

I am trying this code

$date = date('m-d-Y',strtotime($dob));
echo $date;

but getting o/p is 01-01-1970
any body help me to get date formate

Excel stores dates as floating point days since their epoch 1900 (not the unix 1970 epoch in seconds). Some adjustment is required, both in scale and in offset. You don't need a date diff tool, just the right constants for multiply (86400 sec/day) and subtract (days, 1900 to 1970 = 2208988800/86400).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.