本文整理汇总了Python中future.builtins.object.tzname方法的典型用法代码示例。如果您正苦于以下问题:Python object.tzname方法的具体用法?Python object.tzname怎么用?Python object.tzname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类future.builtins.object
的用法示例。
在下文中一共展示了object.tzname方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _check_tzname
# 需要导入模块: from future.builtins import object [as 别名]
# 或者: from future.builtins.object import tzname [as 别名]
def _check_tzname(name):
if name is not None and not isinstance(name, str):
raise TypeError("tzinfo.tzname() must return None or string, "
"not '%s'" % type(name))
# name is the offset-producing method, "utcoffset" or "dst".
# offset is what it returned.
# If offset isn't None or timedelta, raises TypeError.
# If offset is None, returns None.
# Else offset is checked for being in range, and a whole # of minutes.
# If it is, its integer value is returned. Else ValueError is raised.
示例2: tzname
# 需要导入模块: from future.builtins import object [as 别名]
# 或者: from future.builtins.object import tzname [as 别名]
def tzname(self, dt):
"datetime -> string name of time zone."
raise NotImplementedError("tzinfo subclass must override tzname()")
示例3: __str__
# 需要导入模块: from future.builtins import object [as 别名]
# 或者: from future.builtins.object import tzname [as 别名]
def __str__(self):
return self.tzname(None)