Utility conversion from time to milliseconds and vise versa.