Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

epoch to datetime python

>>> import datetime
>>> datetime.datetime.fromtimestamp(1347517370).strftime('%Y-%m-%d %H:%M:%S')
'2012-09-13 14:22:50' # Local time
Comment

epoch to datetime utc python

>>> import datetime
>>> datetime.datetime.utcfromtimestamp(1347517370).strftime('%Y-%m-%d %H:%M:%S')
  '2012-09-13 06:22:50'
# utc time
Comment

current date to epoch python

>>> datetime.datetime(2012,4,1,0,0).timestamp()
1333234800.0
Comment

python epoch to datetime

>>> datetime.datetime.fromtimestamp(1284286794)
datetime.datetime(2010, 9, 12, 11, 19, 54)
Comment

PREVIOUS NEXT
Code Example
Python :: logging - multiple log file 
Python :: flask tutorials 
Python :: installation of uvicorn with only pure python dependencies 
Python :: loop through list of dictionaries python 
Python :: bash python csv to json 
Python :: pandas nan to none 
Python :: 1d array to one hot 
Python :: pandas replace nan with mean 
Python :: seaborn correlation heatmap 
Python :: what is from_records in DataFrame() pandas in python? 
Python :: combination 
Python :: python get parent directory 
Python :: python convert date to timestamp 
Python :: save list to dataframe pandas 
Python :: mailchimp send email python 
Python :: how to sort a dictionary using pprint module in python 
Python :: how to get today weekday in python 
Python :: check if all characters in a string are the same python 
Python :: cryptography python 
Python :: create dictionary from string python 
Python :: how to merge two dictionaries in python 
Python :: Image Watermarking in python 
Python :: tabula python pdf to csv 
Python :: how does urllib.parse.urlsplit work in python 
Python :: length of set python 
Python :: 3 dimensional array numpy 
Python :: python get first character of string 
Python :: menubar pyqt 
Python :: number of column in dataset pandas 
Python :: moving averages python 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =