Skip to content

Instantly share code, notes, and snippets.

@rghv404
Last active January 13, 2021 18:49
Show Gist options
  • Save rghv404/416b00725fbce6de287fa7125c1f3552 to your computer and use it in GitHub Desktop.
Save rghv404/416b00725fbce6de287fa7125c1f3552 to your computer and use it in GitHub Desktop.
Scala Data minus code snippet - works with Java but need syntax revamp
import java.time.format.DateTimeFormatter
import java.time.LocalDate
val effective_date = 20210101
val format = DateTimeFormatter.ofPattern("yyyyMMdd")
val effective_date_last_year = LocalDate.parse(effective_date, format).minusDays(365).format(format)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment