Skip to main content

The Documentation for the @DateTimeFormat Function clearly states that parsing ISO 8601 format is supported:

“Formats FME or ISO date, time, and datetime strings into a custom format [...] Arguments: <datetime> [...] Date, time, or datetime string in Standard FME Date/Time Format or ISO 8601 date and time format.”, so using PT1H as datetime Argument should be valid.

But the Parsing of ISO 8601 date and time format fails:

AttributeManager: Failed to parse 'PT1H' as a datetime value. For FME datetime syntax, please see http://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!Transformer_Parameters/standard_fme_date_time_format.htm . For ISO datetime syntax, please see http://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!Transformer_Parameters/standard_fme_date_time_format.htm#ISO-8601-Duration-Format

Failed to evaluate expression '@DateTimeFormat(PT1H,%H)'. Result is set to null

 

FME Form 2025.1.2.0 (20250829 - Build 25630)

P1TH is a duration not a datetime. The DateTimeCalculator will allow you to use ISO Durations


P1TH is a duration not a datetime. The DateTimeCalculator will allow you to use ISO Durations

I know that it’s an duration, an ISO 8601 duration to be exact, which should be supported by the @DateTimeFormat Function according to the documentation.


Hi ​@_fabian_ ,

No, the @DateTimeFormat function doesn't support ISO 8601 duration, does support ISO 8601 date and time. See the documentation carefuly.

“Date, time, or datetime string in Standard FME Date/Time Format or ISO 8601 date and time format.” -- Date/Time Functions