Since I always forget how to convert datetime to epoch, I just want to write a memo.
In Python
>>> import datetime
>>> d = datetime.datetime(2019,1,1,0,0,0)
>>> print(d)
2019-01-01 00:00:00
>>> epoch = d.strftime("%s")
>>> print(epoch)
1546300800
On Bash
% date -d @1546300800
Tue Jan 1 00:00:00 GMT 2019
0 件のコメント:
コメントを投稿