[Solved] How to split date and time from a string in Python 3?


Check this code.

string="2017-01-20T21:55:00Z"

print string[0:10] 

Output:

2017-01-20

string="2017-01-20T21:55:00Z"

print string[11:19]

Output:

21:55:00

2

solved How to split date and time from a string in Python 3?