Question

DateFormatter

  • 30 January 2015
  • 8 replies
  • 10 views

Badge
Hi,

 

 

I Used a DateFormatter  to export MS Access data in the source format (DD/MM/YYYY)

 

eg 02/12/2014

 

 

Entered (%d%m%Y)

 

            (%d%/%m%/Y)

 

 

Parameters

 

Data Attributes: DateField

 

Date Format: (%d%m%Y)

 

Source Format: DD/MM/YYYY

 

 

The output is: 20140122000000.000 - The output should be 2/12/2014

 

 

Any suggestions??

 

 

Thanks,

 

 

Clive

8 replies

Userlevel 2
Badge +17
Hi Clive,

 

 

Generally, FME readers translate a datetime value into a character string of "yyyymmddHHMMSS" or "yyyymmddHHMMSS.nnn" format automatically.

 

If you are using the Access reader, connect an Inspector transformer to the reader feature type and check the datetime format with the Data Inspector.

 

 

Takashi
Badge +3
Dont use automatic detection. That automaticaly puts all the zeroes.

 

Your second line ?

 

(%d%/%m%/Y) => (%d/%m/%Y)
Badge
Hi Gio,

 

 

How do you disable the automatic detection??

 

 

Regards,

 

 

Clive Swan

 

 
Badge
I created a Transformer (ExtractDate).

 

 

Date is exported as a number:

 

ExtractDate

 

20140122000000.000

 

20140122000000.000

 

 

Cannot see where to disable the automatic detection??

 

 

 

 

 

 

 

 

Thanks,

 

 

Clive
Userlevel 2
Badge +17
"DD/MM/YY" is invalid as the Source Date Format. See the help on the DateFormatter, and specify the source format in correct syntax.

 

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/Transformers/dateformatter.htm

 

 

Badge
Date Attributes: ExtractDate

 

Date Format:     (%d/%m/%Y)

 

Source Format: (%d/%m/%Y)   

 

 

Still exporting Native Oracle format (ExtractDate: 20140122000000.000)
Userlevel 2
Badge +17
If the source date format is "yyyymmddHHMMSS.xxx", FME can detect datetime automatically. Set "Unknown - Automatic Detection" to the Source Date Format parameter (but if you are using FME 2014 or earlier, you have to remove decimal places ".xxx" beforehand).
Badge +3
or be done with it and just use tcl clock functions ....and take control ;) (i think fme uses that anyway, but tcl functions have a lareger scope)

Reply