Can you please tell me how can I convert this date string to total seconds in python?
This string format is 'years-months-days hours:mins:secs'
'2013-01-01 01:01:01'
Can you please tell me how can I convert this date string to total seconds in python?
This string format is 'years-months-days hours:mins:secs'
'2013-01-01 01:01:01'
Use
import time
answer = time.mktime(time.strptime(string, '%Y-%m-%d %H:%M:%S'))