2013-05-21

Date / Datetime string in FME

FME converts a datetime value read from a source dataset into 'YYYYmmddHHMMSS.000' string - having a decimal fraction.
Since the DateFormatter transformer doesn't recognize a digit string with a decimal fraction as a datetime representation, we have to round it before formatting with the transformer.
And we also have to format a date / datetime string into 'YYYYmmdd' or 'YYYYmmddHHMMSS' before writing it into a date / datetime type attribute (field) of a destination dataset.
Community > MS SQL Server Writer: Failed to parse `Date' from attribute value

=====
2013-11-01
There seems to be a case that the Excel writer doesn't convert a datetime string to a datetime value. Quote my post for the Community:
"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."
-- Community > Change ouput format of datetime in Excel_ADO Writer?
=====

2 comments:

  1. Thank you so much, i spent hours looking for this explanation. Although i am amazed at how a program converts the date to format that he can't read directly, having to round a date.....such logic, much intelligence in FME.

    ReplyDelete
    Replies
    1. Thanks for your visiting. I feel happy if the blog helps you even a little.

      Delete