如何获取根据夏令时进行调整的当前时间?
关于获取当前时间有很多问题,但它们对我不起作用
常见的答案是执行以下操作:datetime.datetime.now(pytz.timezone('EST'))
该解决方案不考虑夏令时。现在显示的是晚上 11 点,而实际上应该是中午 12 点。
如何在 python 中获取当前时间并考虑夏令时?
there are lots of questions about getting the current time, but they're not working for me
A common answer is to do the following: datetime.datetime.now(pytz.timezone('EST'))
This solution does not account for daylight savings. It shows now as 11pm when it should be 12pm.
How do I get the current time in python AND account for daylight savings?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论