DateTime dt = new DateTime("2014-09-15T21:20:14");
System.out.println(dt);
System.out.println(dt.plusMillis(581042272).toDateTime().toLocalDateTime().toDateTime(DateTimeZone.forID("GMT")));
dt中的時間是UTC,我想將時間設置爲dt加上毫秒到GMT?但是,時間仍然以UTC格式打印(格林威治標準時間後1小時)。我如何設置它,因此它在前面一個小時?在喬達將UTC轉換爲LocalDateTime?
2014-09-15T21:20:14.000+01:00
2014-09-22T14:44:16.272Z
我知道時間是整整一個小時的背後,因爲我提出這個要求在15點44分16秒GMT
你是什麼意思「dt中的時間是UTC」?顯然,第一行輸出並不是這種情況。你的意思是'「2014-09-15T21:20:14」'意思是UTC? – 2014-09-22 15:01:34
是的,抱歉,如果它不清楚喬恩。 – Adz 2014-09-22 15:02:17