我想为会议申请时区。strftime
def format_filename(recording, file_type, recording_type):
uuid = recording['uuid']
topic = recording['topic'].replace('/', ' ').replace(':', '').replace('?', '')
rec_type = recording_type.replace("_", " ").title()
meeting_time = parse(recording['start_time'])
return '{} - {} UTC - {}.{}'.format(
meeting_time.strftime('%Y.%m.%d'), meeting_time.strftime('%H.%M %p'), topic+" - "+rec_type, file_type.lower())
我用上面的代码得到的文件名示例-2020.12.02-10.00
文件名我想要-2020.12.02-13.00
原始代码-https://github.com/ricardorodrigues-ca/zoom-recording-downloader
如果您只想增加3个小时,可以按以下方式进行:
这会使您以前的日期时间增加3小时
如果您想使用时区,可以在Python的官方文档中找到它:https://docs.python.org/3.7/library/datetime.html#datetime.tzinfo
请看下面的代码:
结果将是:
您可以使用^{} 和^{}
输出
这将在3小时后打印时间
相关问题 更多 >
编程相关推荐