MOBILE-494 Rewrite of formatSeconds function