I tried to change the format of the date while fetching it from the DB but, I'm unable to do so, it is oracle DB.
# execute the sql query my $sth1 = $dbh->prepare($sql1); my $sth2 = $dbh->prepare($sql2); $sth1->execute(); $sth2->execute(); # write the data into worksheet my $row1=1; while(my @field=$sth1->fetchrow_array){ my $col1=0; $field[8]=$priority{$field[8]}; $field[7]=$priority{$field[7]}; $field[33]=$statusyn{$field[33]}; $field[17]=$status{$field[17]}; $field[14]=$statusyn{$field[14]}; $field[44]=$tkttype{$field[44]}; $field[32]=$statusyn{$field[32]}; my $arr_ref=\@field; # my $date = $arr_ref->[$datecol]; # $date =~ s/ //; $worksheet1->write_row($row1,0,$arr_ref); $row1++; }
The date is one of the column in my expoerted data. And it is of the format "06-05-2018" but I need it to be '6-5-2018'.
How can I proceed to change the format to my desired format once after the code is fetched from DB?
Thanks,
JP
2018-09-08 Athanasius added code tags
In reply to Re^4: Date format
by jsuresh
in thread Date format
by jsuresh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |