Answers for "pyspark datetime add hours"

0

pyspark datetime add hours

# PYSPARK DATAFRAME API

from pyspark.sql.functions import unix_timestamp

df.select((unix_timestamp(df.timestamp_col) + 3600).cast('timestamp'))
# 1 hour = 60 seconds x 60 minutes = 3600 seconds
Posted by: Guest on May-31-2021

Python Answers by Framework

Browse Popular Code Answers by Language