The Logic of Time