--- sql2xls.cgi 2008/11/03 22:26:57 18 +++ sql2xls.cgi 2008/11/03 22:29:05 19 @@ -193,9 +193,12 @@ my $data = $row[$col]; if ( $types[$col] =~ m/^date/i ) { $data .= 'T' if $data =~ m/^\d\d\d\d-\d\d-\d\d$/; - $data =~ s/^(\d\d\d\d-\d\d-\d\d)\s(\d\d:\S+)$/$1T$2/; - warn "## $data\n"; + $data =~ s/^(\d\d\d\d-\d\d-\d\d)\s(\d\d:\d\d:\d\d)$/$1T$2/; + warn "## by type datetime $data\n"; $worksheet->write_date_time( $row, $col, $data, $date_format ); + } elsif ( $data =~ s/^(\d\d\d\d-\d\d-\d\d)[\sT](\d\d:\d\d:\d\d)$/$1T$2/ ) { + warn "## heuristic date time: $1T$2\n"; + $worksheet->write_date_time( $row, $col, "$1T$2", $date_format ); } else { $worksheet->write($row, $col, _c( $data ) ); }