Fix time formatting

Check whether toLocaleTimeString supports locales and work around if not.