0
私はScalaの2.11のためのnscala-time
を使用しています:Unixのタイムスタンプから年を取り出す方法は?
<dependency>
<groupId>com.github.nscala-time</groupId>
<artifactId>nscala-time_2.11</artifactId>
<version>2.12.0</version>
</dependency>
目標は、Unixタイムスタンプから年取得するために、次のとおりです。
val t = "1320904800"
val dt = new DateTime(timestamp.toLong)
dt.getYear.toString
問題は、それは私は何の代わりに、2011年の1970を出力していることです間違っている?