Created a JS class for converting time