localtime.py 文件源码

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

项目:kritzbot-legacy 作者: kritzware 项目源码 文件源码
def local_time(self):
        from modules.bot import bot_msg
        localtime = timezone(str(TIME_ZONE))
        time = datetime.now(localtime)
        format_time = time.strftime('%H:%M:%S')
        if TIME_ZONE == 'US/Eastern':
            output = "Local time: {} EST".format(format_time)
        if TIME_ZONE == 'Europe/London':
            output = "Local time: {} GMT".format(format_time)
        if TIME_ZONE == 'Europe/Oslo':
            output = "Local time: {} CEST".format(format_time)
        bot_msg(output)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号