def get_time_of_tag(self, tag):
if not tag:<EOL><INDENT>raise ChangelogGeneratorError("<STR_LIT>")<EOL><DEDENT>name_of_tag = tag["<STR_LIT:name>"]<EOL>time_for_name = self.tag_times_dict.get(name_of_tag, None)<EOL>if time_for_name:<EOL><INDENT>return time_for_name<EOL><DEDENT>else:<EOL><INDENT>time_string = self.fetcher.fetch_date_of_tag(tag)<EOL>try:<EOL><INDENT>self.tag_times_dict[name_of_tag] =timestring_to_datetime(time_string)<EOL><DEDENT>except UnicodeWarning:<EOL><INDENT>print("<STR_LIT>", tag)<EOL>self.tag_times_dict[name_of_tag] =timestring_to_datetime(time_string)<EOL><DEDENT>return self.tag_times_dict[name_of_tag]<EOL><DEDENT>
Get date and time for tag, fetching it if not already cached.

:param dict tag: Tag to get the datetime for.
:rtype: datetime
:return: datetime for specified tag.