Skip to content

Instantly share code, notes, and snippets.

@64lines
Last active February 19, 2019 21:10
Show Gist options
  • Save 64lines/d14a26364fb40f23157944d7d92b3527 to your computer and use it in GitHub Desktop.
Save 64lines/d14a26364fb40f23157944d7d92b3527 to your computer and use it in GitHub Desktop.
from pyspark.sql.functions import *
# Example 1 (recommended)
fact_df = fact_df.withColumn('datecolumn', from_utc_timestamp(col('datecolumn'), "America/Los_Angeles"))
# Example 2 (not recommended)
fact_df = fact_df.withColumn('datecolumn', from_utc_timestamp(col('datecolumn'), "CST"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment