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: 

Get current date as string in databricks using scala

Vibhor
Contributor

I want to get current date in scala as a string for example today current date is 3rd jan, want to store it as a new variable dynamically as below, how to get it.

val currdate : String = “20220103”

when I am using val currdate = Calendar.getInstance.getTime then am not getting output in desired format as above.

5 REPLIES 5

Anonymous
Not applicable

@Vibhor Sethi​ - Thanks for your question. We will circle back around if the other members don't reply first. Thanks in advance for your patience.

Hi thanks. Could you please circle back around the question.

Anonymous
Not applicable

@Vibhor Sethi​ - I'll pass this on to the team. Thank you. 🙂

Thanks it worked

Anonymous
Not applicable

Hey @Vibhor Sethi​ 

Hope you are well!

Thank you for posting your question and letting us know that you were able to resolve the issue. Would you be happy to mark it as the best solution? It would be really helpful for the other members too.

Cheers!

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