log.py 文件源码

python
阅读 72 收藏 0 点赞 0 评论 0

项目:hostapd-mana 作者: adde88 项目源码 文件源码
def formatTime(self, when):
        """
        Return the given UTC value formatted as a human-readable string
        representing that time in the local timezone.

        @type when: C{int}
        @param when: POSIX timestamp to convert to a human-readable string.

        @rtype: C{str}
        """
        if self.timeFormat is not None:
            return time.strftime(self.timeFormat, time.localtime(when))

        tzOffset = -self.getTimezoneOffset()
        when = datetime.datetime.utcfromtimestamp(when + tzOffset)
        tzHour = int(tzOffset / 60 / 60)
        tzMin = int(tzOffset / 60 % 60)
        return '%d/%02d/%02d %02d:%02d %+03d%02d' % (
            when.year, when.month, when.day,
            when.hour, when.minute,
            tzHour, tzMin)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号