I Have fetched timestamp from my log file but i need to remove millisecond and write it back to a new file.
i.e Ex:3:32:15.89567
I need to remove .89567 Finally i need is 3:32:15(hour,minute and second)
Can anyone help on this.
I Have fetched timestamp from my log file but i need to remove millisecond and write it back to a new file.
i.e Ex:3:32:15.89567
I need to remove .89567 Finally i need is 3:32:15(hour,minute and second)
Can anyone help on this.
Cut the string at the first '.' from the right with the rfind string method :
my_string = '3:32:15.89567'
cut_string = my_string[ : my_string.rfind('.') ]