How to get tomorrows date in Scala

1 Answer

0 votes
import java.time.LocalDate

object TomorrowDate {
  def main(args: Array[String]): Unit = {
    // Get today's date
    val today = LocalDate.now()

    // Calculate tomorrow's date by adding one day
    val tomorrow = today.plusDays(1)

    println(s"Tomorrow's date is: $tomorrow")
  }
}

  
     
/*
run:
  
Tomorrow's date is: 2025-04-10

*/

 



answered Apr 9, 2025 by avibootz
...