Solved

How do I convert a number of seconds to a time format

  • 18 April 2016
  • 3 replies
  • 18 views

I am extremely new to FME.

In my data-set, I have a column that displays number of seconds . I need this to be in a time format.

Example: column data displays 181, I need this to read 0:03:01.

Any help would be appreciated.

icon

Best answer by takashi 19 April 2016, 11:51

View original

3 replies

Userlevel 2
Badge +16

The DateFormatter transformer should be able to do this.

Source format is %s, Destination format %T

Userlevel 2
Badge +17

Hi @ryankrawchuk, the DateFormatter could be a quick solution, but it may not work as expected if the timezone of your machine is not set to UTC - Coordinated Universal Time.

If you didn't get your required result from the transformer, try a TclCaller with this Tcl Expression. Assume that an attribute called "_seconds" stores the number of seconds.

clock format [FME_GetAttribute "_seconds"] -format %T -timezone UTC

Both of those worked, though Takashi's answer worked with no further issues.

Thanks!

Reply