Get current date as string in databricks using scala
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2022 07:41 AM
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.
Labels:
- Labels:
-
Current Date
-
Scala