Better implementation of date and time formatting.