Converting Time module to JS.