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