简体   繁体   English

Python 读取日期时间字符串(使用 python 读取 T01:00:00-07:00)

[英]Python reading datetime string ( reading T01:00:00-07:00 with python )

Has anyone converted this kind of times before?以前有人转换过这种时代吗?

2020-10-12T01:00:00-07:00 to 2020-10-12T09:00:00-07:00

equals等于

Monday, October 12, 2020 at 10:00 AM – 6:00 PM UTC+02

to datetime objects?日期时间对象?

2020-10-12T01:00:00-07:00
<--date--> <-time-><zone>

This means 1am on October 12th, 2020 , in the time zone 7 hours west of UTC (running through the middle of the US , basically).这意味着October 12th, 2020October 12th, 2020 1am ,在 UTC 以西 7 小时的时区(基本上贯穿美国中部)。

It's actually one of the ISO8601 formats, used for date/time data interchange.它实际上是ISO8601格式之一,用于日期/时间数据交换。

I believe the dateutil.parser() library can handle this in Python.我相信dateutil.parser()库可以在 Python 中处理这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 python 中将此字符串 &#39;2022-07-07T10:30:00-07:00&#39; 转换为 datetime obj? - How would I convert this string '2022-07-07T10:30:00-07:00' into datetime obj in python? Python日期时间1970-01-01 07:00:07 - Python Datetime 1970-01-01 07:00:07 将日期2018-04-03T14:10:00-07:00格式化为Python中任何可读的日期/时间 - Formatting date 2018-04-03T14:10:00-07:00 to any readable date/time in Python 在 Python 中将带有 +00:00 的字符串转换为日期时间 - Convert string with +00:00 to datetime in Python 如何在 python 中将这种格式 '2020-01-01 00:00:00+00:00' 的 str 转换为日期时间? - How to convert a str like this format '2020-01-01 00:00:00+00:00' to datetime in python? Python 2.7 - 使用 +01:00 转换日期时间 - Python 2.7 - Convert datetime with +01:00 将 2021-01-18T11:18:10.833876+00:00 转换为日期时间 python - convert 2021-01-18T11:18:10.833876+00:00 to datetime python 如何将Python中的01:00:00转换为integer? - How to convert 01:00:00 into integer in Python? 如何在格式为“0000-00-00T00:00:00+00:00”的字符串上使用 datetime.strptime? - How can I use datetime.strptime on a string in the format '0000-00-00T00:00:00+00:00'? Django 1.11 - 将时区为 2018-01-01T00:00:00+03:00 的日期时间字符串转换为日期时间 object 以用于查询集 - Django 1.11 - convert a datetime string with timezone 2018-01-01T00:00:00+03:00 into datetime object to be used for queryset
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM