Fixing a problem on date and hour formatting