Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

You can use the strptime function.

For instance, that would give:

myDatetime = datetime.strptime(myString.split(".")[0], "%Y-%m-%dT%H:%M:%S")

[EDIT] Well, I've seen this has been treated in another thread with a better answer than mine: How do I parse an ISO 8601-formatted date and time?How do I parse an ISO 8601-formatted date and time?

You can use the strptime function.

For instance, that would give:

myDatetime = datetime.strptime(myString.split(".")[0], "%Y-%m-%dT%H:%M:%S")

[EDIT] Well, I've seen this has been treated in another thread with a better answer than mine: How do I parse an ISO 8601-formatted date and time?

You can use the strptime function.

For instance, that would give:

myDatetime = datetime.strptime(myString.split(".")[0], "%Y-%m-%dT%H:%M:%S")

[EDIT] Well, I've seen this has been treated in another thread with a better answer than mine: How do I parse an ISO 8601-formatted date and time?

deleted 7 characters in body
Source Link
user142162
user142162

You can use the strptimestrptime function.

For instance, that would give:

myDatetime = datetime.strptime(myString.split(".")[0], "%Y-%m-%dT%H:%M:%S")

[EDIT] Well, i'veI've seen this has been treated in another thread with a better answer than mine: How do I parse an ISO 8601-formatted date and time?

Regards,

Max

You can use the strptime function.

For instance, that would give:

myDatetime = datetime.strptime(myString.split(".")[0], "%Y-%m-%dT%H:%M:%S")

[EDIT] Well, i've seen this has been treated in another thread with a better answer than mine: How do I parse an ISO 8601-formatted date and time?

Regards,

Max

You can use the strptime function.

For instance, that would give:

myDatetime = datetime.strptime(myString.split(".")[0], "%Y-%m-%dT%H:%M:%S")

[EDIT] Well, I've seen this has been treated in another thread with a better answer than mine: How do I parse an ISO 8601-formatted date and time?

added 30 characters in body
Source Link
JMax
  • 26.7k
  • 12
  • 74
  • 89

You can use the strptime function.

For instance, that would give:

myDatetime = datetime.strptime(myString.split(".")[0], "%Y-%m-%dT%H:%M:%S")

[EDIT] Well, i've seen this has been treated in another thread with a better answer than mine: How do I parse an ISO 8601-formatted date and time?

Regards,

Max

You can use the strptime function.

For instance, that would give:

myDatetime = datetime.strptime(myString.split(".")[0], "%Y-%m-%dT%H:%M:%S")

[EDIT] Well, i've seen this has been treated in another thread : How do I parse an ISO 8601-formatted date and time?

Regards,

Max

You can use the strptime function.

For instance, that would give:

myDatetime = datetime.strptime(myString.split(".")[0], "%Y-%m-%dT%H:%M:%S")

[EDIT] Well, i've seen this has been treated in another thread with a better answer than mine: How do I parse an ISO 8601-formatted date and time?

Regards,

Max

Source Link
JMax
  • 26.7k
  • 12
  • 74
  • 89
Loading