How can I convert seconds to an HH-MM-SS string using JavaScript?
For anyone using AngularJS, a simple solution is to filter the value with the date API, which converts milliseconds to a string based on the requested format. Example:
Offer ends in {{ timeRemaining | date: 'HH:mm:ss' }}
Note that this expects milliseconds, so you may want to multiply timeRemaining by 1000 if you are converting from seconds (as the original question was formulated).