0
我使用nscala-time
斯卡拉2.11:如何從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
的問題是,它輸出1970年而不是2011年我是什麼做錯了?