cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.