Need to extract date from DateTime field using FME but not working

1425
5
05-03-2023 07:15 AM
AndrewReynoldsDevon
Occasional Contributor

The List Date in the bottom photo contains a field called ListDate which is stored in a SQL database. 

We're using their WFS to download the data however due to the validation in Pro we can't see any date fields so we're using FME. I'm trying to use the transformer 'date time converter' but I get the prompts asking which fields I want & as you can see the software is splitting out 1 field into several which are all 'missing'. Which list elements should I select? Also in the select list elements box what number should be entered there? I just need the date so can strip out the time element. 

extra columns.JPGlist elements.JPGlist of fields.JPG

ListDate.png

0 Kudos
5 Replies
RenatoSalvaleon3
Esri Contributor

@AndrewReynoldsDevon is the WFS service public? Can you share the link?

0 Kudos
AndrewReynoldsDevon
Occasional Contributor

We can't share the WFS as it's secure to our IP however we have now got the import working by resetting the defaults on the WFS incoming connection ? odd

The next issue is the dates are in an American format so I'm trying to use the date time converter to convert from the American format of Month Day Year Time to the English format of just Day, Month & Year without the time. I have tried several combinations but it keeps on giving me an error - any clues?

datetime.JPG

0 Kudos
AndrewReynoldsDevon
Occasional Contributor

I have the date time converter working & have set the setting 'passthrough nulls' to Yes but there are 6 records below which have the FME rejection code INVALID_INPUT but these are genuine records just without a date. Any ideas?

 

invalid input.JPG

0 Kudos
AndrewReynoldsDevon
Occasional Contributor

I have a new issue where the date time converter is rejecting single date formats which are 1-9. The dates from 10-31 are working ok or I can get 1-9 working with %b ?%e %Y however if I use the 2nd format it change all dates which are larger than 10 to single digits so need to build a else statement but am struggling.

0 Kudos
RenatoSalvaleon3
Esri Contributor

DateTimeCoverter does not have ConditionalValue option. So you could either use a TestFilter before your DateTimeConverter transformer and have multiple data converters for each condition or you could use an AttributeManager where you can use a Conditional Value option and a DateTime Format function to use in the Text Editor.

 

RenatoSalvaleon3_0-1683207350950.png

 

RenatoSalvaleon3_1-1683207380456.png

 

0 Kudos