codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  trying to write dates from perl to Excel  marlboroguy58 at 03:40 on Tuesday, March 27, 2007
 

hi,

i have written a script that interacts with MS Excel.
it extracts data from a database and populates an excel sheet.
there are some date fields in the database, but when the script writes the value in the sheet it writes it as a string. i tried formating the cells for date but it doesn't help.

Is there a way where i can convert the date value in a way that excel recognizes it.
here is the piece of code that i use.

sub setXLCellValue
{
my ($sheet, $row, $col, $val) = @_;
$sheet->Cells($row,$col)->{'Value'} = $val;
}

here $val is a string of the format MM/DD/YYYY...how do i convert it to date format that excel can recognize it. As i said earlier i have tried formatting the sheet, it does not help.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Hi need help in time()Fn
•  Help me out in wirting a perl script
•  how to get the ip address & country of the webpage visitor
•  Firefox
•  Re: Perl - Read and Write output file
•  Re: Print and print preview file on the website without using the File - Print on the IE
•  Re: While Loops - Help please!
•  trying to write dates from perl to Excel
•  5x5 Tic Tac Toe


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007