Laur's blog
  • Home
  • About
  • Support my work
Sign in Subscribe

timestamp

A collection of 2 posts
Timestamp to DateTime Serializer Field for DRF
datetime

Timestamp to DateTime Serializer Field for DRF

I'm currently trying to deserialize JSON data to a Django model. This is quite straight forward for most numeric fields, but I have a `DateTime` field which is stored as a timestamp in the original JSON.
Sep 29, 2017 2 min read
Convert Timestamp to DateTime for Pandas DataFrame
dataframe

Convert Timestamp to DateTime for Pandas DataFrame

To convert a pandas data frame value from unix timestamp to python datetime you need to use: pd.to_datetime(df['timestamp'], unit='s') where: * timestamp is the column containing the timestamp value * unit='s' defines the unit of the timestamp (seconds in this
Aug 8, 2017 1 min read
Page 1 of 1
Laur's blog © 2025
  • Sign up
Powered by Ghost