Convert C# DateTime format yyyy-MM-dd HH:mm:ss:fff to python

import datetime

# get current time
now = datetime.now()

# string format

now.strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
'2019-11-25 11:28:54.718'


Note: fff is The milliseconds in a date and time value.