Excell to CSV Date Calculations
| From: | Ray Hauge | Date: | Thu, 02 Feb 2006 20:38:46 +0000 |
| Subject: | Excell to CSV Date Calculations | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-229760@lists.php.net to get a copy of this message | ||
Hello all,
I have a script that takes a CSV file in as data and does some updates to the
DB accordingly. Some of those values are dates. When I save the spreadsheet
in Open Office to a CSV file, the dates are saved as the internal date format
of Open Office. I need to figure out a way to convert that number into an
actual date
I know that this might not necessarily be a PHP question, but I was hoping to
be able to solve this problem with PHP. I checked, and MS Excel is one day
off from Open Office on the internal date values, which throws a huge wrench
in my program, since not everyone has Excel here.
So, there are two possible solutions to my problem. Find a way to make the
date the text it is supposed to represent and save that in the CSV file, or
use PHP to calculate the correct date.
On a side note, I did figure out a function to be able to handle this in the
spreadsheet, but the users will ask questions even if I show them time and
time again how to do it.
=CONCATENATE(MONTH(D2); "/"; DAY(D2); "/"; YEAR(D2))
Just trying to find an easier solution :)
Thanks!
--
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
http://www.americanstudentloan.com
1.800.575.1099