Need help - Uploading Excel XLS files and converting Excel's Date and Time format |
[eluser]skattabrain[/eluser]
Hello, I'm trying to make uploading Excel data as easy as possible for my users. In the past, I had users convert their XLS files to CSV ... then they could upload and import their data using my tools. This time, it has to be straight XLS files. So I did a quick search on the wiki and found this - http://codeigniter.com/wiki/Excel_Reader_Class/ (thanks to Derek & James Gifford for the work there). So this works great, but I'm having trouble with 1 crucial piece ... taking the date and time field from the XLS and converting it into a date I can work with. I found a couple functions searching google for converting the date part ... but not the time. Excel stores it's dates and times in a serial format. I can't seem to figure this out ... driving me nuts! This will return the date, but no time ... Code: function excel_D2DMY($days) { Here is a snippet of the array the Excel Reader creates ... Code: array(13) { Specifically ... these pieces of the array ... Code: [1]=> Any ideas? My users have several of these and their different XLS files have different date formatting ... so CSV exports will be a problem ... I chose to keep XLS because Excel keeps the the date in this particular format ... so if I can convert it ... then I'm set! Thanks if you have input. |
Messages In This Thread |
Need help - Uploading Excel XLS files and converting Excel's Date and Time format - by El Forum - 08-28-2008, 08:47 AM
Need help - Uploading Excel XLS files and converting Excel's Date and Time format - by El Forum - 10-22-2008, 04:56 PM
Need help - Uploading Excel XLS files and converting Excel's Date and Time format - by El Forum - 10-23-2008, 01:29 PM
Need help - Uploading Excel XLS files and converting Excel's Date and Time format - by El Forum - 10-23-2008, 01:37 PM
Need help - Uploading Excel XLS files and converting Excel's Date and Time format - by El Forum - 10-23-2008, 01:41 PM
Need help - Uploading Excel XLS files and converting Excel's Date and Time format - by El Forum - 10-23-2008, 01:44 PM
|