in reply to Re: Date column in excel
in thread Date column in excel

I am not using any module as such i am using this code in html
xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns:ss='urn:schemas-microsoft-com:office:spreadsheet
and using x:str to convert into string is there anyway without using any module where i could specify a date cell.
Is there any way where i could do that without changing much of my code.
Thanks

Replies are listed 'Best First'.
Re^3: Date column in excel
by muntfish (Chaplain) on Jun 08, 2004 at 12:20 UTC

    If I ever need to figure out how to do this, I start by creating a simple Excel sheet, do "Save as HTML" or whatever, and see how Excel has saved it.

    Just did a quick test and it looks like the HTML format is:

    <td height=17 class=xl24 align=right style='height:12.75pt' x:num="38018">01/02/2004</td>

    So you probably need to convert the date into numeric form (shouldn't be too difficult - but you'll need to check Excel's documentation to find its epoch, as that will most likely not be the same as perl's) for the x:num attribute...

    Update: I should add that if you're doing lots of this and you want it to be robust, you ought to look into a ready-made solution, such as Spreadsheet::WriteExcel. I've only ever needed to do this very occasionally, and so I've never actually looked properly at what modules are available...

    s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$&;
Re^3: Date column in excel
by hakkr (Chaplain) on Jun 08, 2004 at 12:07 UTC
    well I'd say a date is more a number than a string at least it will be to excel internally