Skip to content

Instantly share code, notes, and snippets.

@CrashLaker
Last active May 5, 2019 02:47
Show Gist options
  • Save CrashLaker/a5de0f0fae4ebc54feb6669b49b474b4 to your computer and use it in GitHub Desktop.
Save CrashLaker/a5de0f0fae4ebc54feb6669b49b474b4 to your computer and use it in GitHub Desktop.
python dateing-1
import datetime
import time
date = datetime.datetime(2019,5,1) # date object
print(date) # 2019-05-01 00:00:00
ts = time.mktime(date.timetuple()) # timestamp in seconds
print(ts) # 1556668800.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment