Added time conversion functions

Added:
- ConvertToTime function
- digits function