I have got a string of time data: "2019-08-02 18:18:06.02887" and I am trying to rewrite it as another string "EV190802_181802" in another file.
What I am trying now is splitting the string into lists and reconstructing another string by those lists:
hello=data.split(' ')
date=hello[0]
time=hello[1]
world=hello[0].split('-')
stack=time.split('.')
overflow=stack[0].split(':')
print('EV' + world[0] + world[1] + world[2] + '_' + overflow[0] + overflow[1] + overflow[2])
However, I have no idea how to remove 20 in 2019/world[0]. Is there any way I could remove '20'?
If there are alternative methods to rewrite the string, welcome to suggest as well.