Scala Date & Time Programs

In Scala programming language, there is no date-time library or function, to work with the date and time –we can use java data time, calendar, Date library to deal with dates.

This section contains solved Scala Date & Time programs, practice these Scala programs to learn the concepts date & time, these programs contain the solved code, outputs, and the detailed explanation of the statements, functions used in the Scala Date & Time programs.

List of Scala Date & Time Programs

  1. Scala program to print the current time
  2. Scala program to print the current time in milliseconds
  3. Scala program to print the current date
  4. Scala program to print the current date and time using getTime() method
  5. Scala program to print the current date and time using Date class
  6. Scala program to format the current time using SimpleDateFormat class
  7. Scala program to convert a string into a date
  8. Scala program to convert a string into date-time
  9. Scala program to compare two dates
  10. Scala program to compare two dates using compareTo() method
  11. Scala program to print tomorrow's date
  12. Scala program to print yesterday's date
  13. Scala program to add days into the current date
  14. Scala program to subtract days from the current date
  15. Scala program to demonstrate the after() method of Date class
  16. Scala program to demonstrate the before() method of Date class
  17. Scala program to set datetime using setTime() method
  18. Scala program to find the difference between the two dates


Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.