Skip to content

Instantly share code, notes, and snippets.

View daknhh's full-sized avatar
:octocat:

David Krohn daknhh

:octocat:
View GitHub Profile
@junzis
junzis / python_time.py
Last active February 11, 2024 14:44
Time conversions in python
from datetime import datetime
import time
#-------------------------------------------------
# conversions to strings
#-------------------------------------------------
# datetime object to string
dt_obj = datetime(2008, 11, 10, 17, 53, 59)
date_str = dt_obj.strftime("%Y-%m-%d %H:%M:%S")
print date_str