Skip to main content
Solved

Calculating total second from hh:mm:ss field

  • November 6, 2023
  • 2 replies
  • 52 views

Hello - I have several fields in hh:mm:ss format and I want to sum the total number of seconds from all parts all the field.

 

For example:

01: 10: 30

would total 4230 seconds

 

Does anyone know the best way to achieve this?

 

I am brining the data in from an API and have used the JSONFragmenter to tabularise the data.

 

I assume the current data type for the fields is string as that's the default for FME?

Best answer by nielsgerrits

This can be done using an AttributeCreator:

@DateTimeDiff(@Value(time),000000,seconds)

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

nielsgerrits
VIP
Forum|alt.badge.img+61
  • Best Answer
  • November 6, 2023

This can be done using an AttributeCreator:

@DateTimeDiff(@Value(time),000000,seconds)

 


This can be done using an AttributeCreator:

@DateTimeDiff(@Value(time),000000,seconds)

 

Thank you so much! :)