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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group