Skip to content

Instantly share code, notes, and snippets.

@OSHI7
OSHI7 / dateStuff.py
Created October 6, 2020 21:26
SampleGist-1
a=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print(a)
time=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
x=['2017-07-27 11:38:53', '2017-07-27 11:39:00','2017-07-27 11:39:08', '2017-07-27 11:40:02']
x=['2017-07-27 11:38:53', '2017-07-27 11:39:00','2017-07-27 11:39:08', '2017-07-27 11:40:02']
y=[0, 1, 1, 0]
x2 = [datetime.strptime(elem, '%Y-%m-%d %H:%M:%S') for elem in x]
dates=matplotlib.dates.date2num(x2)