cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Date Formats while extracting data from Cosmos Mongo DB using Azure Databricks.

Swapnil1998
New Contributor III

I have been trying to extract one date field from cosmos which looks like as below:

"lastModifiedDate" : {

        "$date" : 1668443121840

    }

when the above field is extracted using Databricks it gets converted into a date format which looks like this: 2022-11-14T16:25:21.840+0000

I would want to keep the date format as is in Cosmos in the epoch/unix timestamp as this is important for the incremental extraction.

OR

I would like to know is there any pyspark function to convert date format: 2022-11-14T16:25:21.840+0000 back to 1668443121840

Thanks! in advance

0 REPLIES 0

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now