Format Seconds as time units


/ Published in: JavaScript
Save to your folder(s)

A simple function for taking a number of seconds and displaying it as separate units of time. Designed to be modified to support any consistent units of time as it automatically sorts units by their size and calculates remaining seconds at each step. Supports hiding units after a specified unit.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.