Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Convert DateTime to Unix timestamp in Python

from datetime import datetime

# current date and time
currentDateTime = datetime.now()
print("Current Date Time is ", currentDateTime)

# convert datetime to timestamp
timestamp = datetime.timestamp(currentDateTime)
print("Current Unix Timestamp is ", timestamp)
Source by itsmycode.com #
 
PREVIOUS NEXT
Tagged: #Convert #DateTime #Unix #timestamp #Python
ADD COMMENT
Topic
Name
3+7 =