Question

Change ouput format of datetime in Excel_ADO Writer?

  • 31 October 2013
  • 2 replies
  • 2 views

Hi!

 

 

How do I change the output format "datetime" in Excel_ADO writer?

 

In the reader the date is on YYYY-MM-DD format but when i'm writing it into Excel_ADO the format changes to YYYYMMDD000000, probably on the format YYMMDDHHMMSS.

 

 

How can I get the Excel_ADO writer to print it in the ouput file on YYYY-MM-DD format instead?

 

 

Best regards

 

 

Christer

2 replies

Userlevel 2
Badge +17
Hi Christer,

 

 

As far as I know, database writers (e.g. SQL Server) convert automatically a datetime string formatted in YYYYmmdd / YYYYmmddHHMMSS to a datetime value, when writing the value into datetime type field.   I tested Excel writer in FME 2013 SP4, Windows Xp SP3.

 

Input datetime string format is YYYYmmddHHMMSS in all cases.

 

 

Results:

 

1) XLS_ADO writer, Excel version 97/2000/2002/2003 (*.xls)

 

Writer User Attribute Type = datetime

 

The value is written as a datetime value. But the field format cannot be specified in FME, it has to be modified manually after writing if necessary.

 

 

2) XLS_ADO writer, Excel version 2007 (*.xlsx)

 

Writer User Attribute Type = datetime

 

The value is written as a character string. Why?

 

 

3) XLSXW writer (new Excel writer added in FME 2013 SP2)

 

Writer User Attribute Type = datetime

 

The value is written as a datetime value, and also the field format (e.g. yyyy-mm-dd) can be specified in the writer feature type dialog box.

 

 

Traditional XLS_ADO writer is currently deprecated. I recommend you to use new XLSXW writer, if possible.

 

 

Takashi
Badge
Hi,

 

 

Having just specified the date format for a lot of dates in my workspace, I really miss a way of specifying the default date format for writing to Excel.

 

 

Regards,

 

Steinar

Reply