title: AWS Glue ETL - Converting Epoch to timestamp
body: <p>as the title states, I'm having trouble converting a column on a Dynamic Frame  from Epoch to a timestamp.</p>
  <p>I have tried onverting in into a Data Frame and back to Dynamic Frame but it is not working.</p>
  <p>This is what I'm working with:</p>
  <pre><code>import sys
  from awsglue.transforms import *
  from awsglue.utils import getResolvedOptions
  from pyspark.context import SparkContext
  from awsglue.context import GlueContext
  from awsglue.dynamicframe import DynamicFrame
  
  from pyspark.sql import functions as f
  from pyspark.sql import types as t
  from pyspark.sql.functions import udf
  
  from awsglue.job import Job
  
  ## @params: [JOB_NAME]
  args = getResolvedOptions(sys.argv, ['JOB_NAME'])
  
  sc = SparkContext()
  glueContext = GlueContext(sc)
  spark = glueContext.spark_session
  job = Job(glueContext)
  job.init(args['JOB_NAME'], args)
  
  datasource0 = glueContext.create_dynamic_frame.from_catalog(database = &quot;s3-sat-dth-prd&quot;, table_name = &quot;s3_sat_dth_prd_vehicle&quot;, transformation_ctx = &quot;datasource0&quot;)
  
  applymapping1 = ApplyMapping.apply(frame = datasource0, mappings = [(&quot;in&quot;, &quot;int&quot;, &quot;in&quot;, &quot;int&quot;), (&quot;out&quot;, &quot;int&quot;, &quot;out&quot;, &quot;int&quot;), (&quot;ts&quot;, &quot;long&quot;, &quot;ts&quot;, &quot;long&quot;), (&quot;cam&quot;, &quot;string&quot;, &quot;cam&quot;, &quot;string&quot;), (&quot;subclass&quot;, &quot;string&quot;, &quot;subclass&quot;, &quot;string&quot;)], transformation_ctx = &quot;applymapping1&quot;)   
  
  selectfields2 = SelectFields.apply(frame = applymapping1, paths = [&quot;in&quot;, &quot;out&quot;, &quot;ts&quot;, &quot;cam&quot;, &quot;subclass&quot;], transformation_ctx = &quot;selectfields2&quot;)
  
  resolvechoice3 = ResolveChoice.apply(frame = selectfields2, choice = &quot;MATCH_CATALOG&quot;, database = &quot;s3-sat-dth-prd&quot;, table_name = &quot;test_split_array_into_records_json&quot;, transformation_ctx = &quot;resolvechoice3&quot;)
  
  datasink4 = glueContext.write_dynamic_frame.from_catalog(frame = resolvechoice3, database = &quot;s3-sat-dth-prd&quot;, table_name = &quot;test_split_array_into_records_json&quot;, transformation_ctx = &quot;datasink4&quot;)
  job.commit()
  </code></pre>
  <p>What I've tried was creating a Data Frame <code>tsconvert = resolvechoice3.toDF()</code> and turn it back into Dynamic Frame <code>resolvechoice4 = DynamicFrame.fromDF(tsconvert, GlueContext, resolvechoice4)</code>; I get a syntax error at the last code snippet i pasted right at the end of <code>resolvechoice4</code>.</p>
  <p>COuld not find if there is anything built into Glue to convert to timestamp. When Iìll make sure the data is correctly written to S3, Redshift will be my Target.</p>
  <p>Has anybody ever done anything like this and could lead me the way?</p>
  <p>Thanks in advance.</p>