scala提取字符串中数字
The "calendar" class handles working with date and time in Scala, the class generates the current time in the following format,
“ calendar”类处理Scala中的日期和时间 ,该类以以下格式生成当前时间,
Thu Apr 23 06:10:37 GMT 2020
We can extract different parts like date, month, and year.
我们可以提取日期,月份和年份等不同部分。
计划在Scala中获取日期 (Program to get date in Scala)
import java.util.Calendar
import java.text.SimpleDateFormat
object MyClass {
def main(args: Array[String]) {
val cal = Calendar.getInstance
val dateTime = cal.getTime
println("Full date information : " + dateTime)
val dateFormat = new SimpleDateFormat