Welcome Guest, Not a member yet? Register   Sign In
Need help - Uploading Excel XLS files and converting Excel's Date and Time format
#3

[eluser]Randy Casburn[/eluser]
There is a new datatime XML format available in Excel 2007. I use this to avoid this very situation. I've included a Windows-only (sorry) way to demonstrate how easy it is to retrieve a date string directly from Excel.

This will only work if you have MS Excel 2007 on your Windows box. It will fail if you have an earlier version or don't have Excel at all.

I realize this does not meet your needs since I'm using PHP COM, but I thought perhaps you could explore what's here and use it to discover a better solution for yourselves.

The key part you want to look at is in index.php line 18. Note the three cells are datetime types and I use a parameter in the last one to return the string rather than the funky double data type (variant).

Hope this is helpful.

Well drat! The forum won't let me attach a zip file. Send me a pm and I'll send you the file that way or via e-mail if you're interested.

Randy


Messages In This Thread
Need help - Uploading Excel XLS files and converting Excel's Date and Time format - by El Forum - 10-23-2008, 01:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB