def _parse_revision_date(self):
doc_datetime = None<EOL>if not self.is_draft:<EOL><INDENT>date_command = LatexCommand(<EOL>'<STR_LIT:date>',<EOL>{'<STR_LIT:name>': '<STR_LIT:content>', '<STR_LIT>': True, '<STR_LIT>': '<STR_LIT:{>'})<EOL>try:<EOL><INDENT>parsed = next(date_command.parse(self._tex))<EOL>command_content = parsed['<STR_LIT:content>'].strip()<EOL><DEDENT>except StopIteration:<EOL><INDENT>command_content = None<EOL>self._logger.warning('<STR_LIT>')<EOL><DEDENT>if command_content is not None and command_content != r'<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>doc_datetime = datetime.datetime.strptime(command_content,<EOL>'<STR_LIT>')<EOL>project_tz = timezone('<STR_LIT>')<EOL>localized_datetime = project_tz.localize(doc_datetime)<EOL>doc_datetime = localized_datetime.astimezone(pytz.utc)<EOL>self._revision_datetime_source = '<STR_LIT>'<EOL><DEDENT>except ValueError:<EOL><INDENT>self._logger.warning('<STR_LIT>'<EOL>'<STR_LIT>',<EOL>command_content)<EOL><DEDENT><DEDENT><DEDENT>if doc_datetime is None:<EOL><INDENT>content_extensions = ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>try:<EOL><INDENT>doc_datetime = get_content_commit_date(<EOL>content_extensions,<EOL>root_dir=self._root_dir)<EOL>self._revision_datetime_source = '<STR_LIT>'<EOL><DEDENT>except RuntimeError:<EOL><INDENT>self._logger.warning('<STR_LIT>'<EOL>'<STR_LIT>',<EOL>self._root_dir)<EOL><DEDENT><DEDENT>if doc_datetime is None:<EOL><INDENT>doc_datetime = pytz.utc.localize(datetime.datetime.now())<EOL>self._revision_datetime_source = '<STR_LIT>'<EOL><DEDENT>self._datetime = doc_datetime<EOL>
r"""Parse the ``\date`` command, falling back to getting the
        most recent Git commit date and the current datetime.

        Result is available from the `revision_datetime` attribute.