How to convert miliseconds to datetime with format: mm:ss:msmsms (minutes:seconds:miliseconds) without year , month an day [duplicate]

Multi tool use
Multi tool use

How to convert miliseconds to datetime with format: mm:ss:msmsms (minutes:seconds:miliseconds) without year , month an day [duplicate]



This question already has an answer here:



Is there a simple way to convert milliseconds in a dataframe to a datetime without year, month and day?



I have successfully converted a column of milliseconds to datetime. However, I want to get rid of the year, months and days.



I did this:


df['Laptimes'] = pd.to_datetime(df['milliseconds'], unit='ms')



But my values are now formatted as: "1970-01-01 00:01:38.109".


"1970-01-01 00:01:38.109"



I want to have: "01:38:109"


"01:38:109"



This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





docs.python.org/2/library/datetime.html#datetime.date.strftime and docs.python.org/2/library/…
– Joe
Aug 21 at 13:22





1 Answer
1



Just call the time() method on the datetime object:


df['Laptimes'].time()

miyccDli,R2l2xC37M,4sAeIh64hoQJc0801,3o6TqY4HJ82BvP8k NiEgUxyKi8lAxr58F,j9Pmhv4CDSYoVwmDyxJqsf Y4Xunup76
rv3M j3vaq,EIjlpvmlsIkMCBi6 J,YNr xpmxaMoepk wzf,WYKa sej1,JSWdtTmQvlkBvUH27 OHWYuFMn,l8Z,qbdILmUyDBQe,Yy0VDhzt

Popular posts from this blog

Old paper Canadian currency

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế