Are you on a older version of FME? Should be DateTimeFormat with capital Y if you want 1950
@DateTimeFormat($(date),%d/%m/%Y)
You might have to force it with a DateTimeConverter after the AttributeCreator.
Hi @left65,
As @ebygomm mentions, it looks like you got the syntax slightly wrong.
Instead of:
dateformat($(PositionEffective).%d/%m/%y)
in your example, it should be:
@DateTimeFormat($(PositionEffective),%d/%m/%Y)
You can use this function directly within the AttributeCreator, like this:
Edited to actually include the screenshot! Not sure what happened there...
Hope this helps.
Si
Hi @left65
if the date comes in yyyy-mm-dd format (i.e. not in FME date format), it needs to be parsed first. You can use
@DateTimeFormat(@DateTimeParse(@Value(_date),%Y-%m-%d),%d/%m/%Y
expression to parse and then format your date. There is also DateTimeConverter transformer that will help you avoid writing nested functions :)
Hi @left65
if the date comes in yyyy-mm-dd format (i.e. not in FME date format), it needs to be parsed first. You can use
@DateTimeFormat(@DateTimeParse(@Value(_date),%Y-%m-%d),%d/%m/%Y
expression to parse and then format your date. There is also DateTimeConverter transformer that will help you avoid writing nested functions :)
My version of FME will format from yyyy-mm-dd without parsing first.
Incidentally, i think in this case it's a date parameter that is displayed as yyyy-mm-dd when you selected but is actually stored as an FME date.