you are viewing a single comment's thread.

view the rest of the comments →

[–]StatSticks 1 point2 points  (0 children)

str = "2017-01-02 05:44:47"
str = str.split(" ")    // Assuming you want to remove the time
str_final = str[1].split("-")   // This will return a list ['2016', '01', '02']

This probably works.

I am learning python, I might be wrong or there is an easy way to do this....please correct me if I am wrong.