I've been trying to convert a server's date and time to user's one with the following code
@Test
public void playingWithJodaTime() {
LocalDateTime localDateTime = new LocalDateTime();
System.out.println("server localDateTime : "
+ localDateTime.toDateTime(DateTimeZone.getDefault()).toDate());
System.out.println("user's localDateTime : "
+ localDateTime.toDateTime(DateTimeZone.forID("Asia/Jakarta"))
.toDate());
}
Printed result
server localDateTime : Tue Dec 17 00:04:29 SGT 2013
user's localDateTime : Tue Dec 17 01:04:29 SGT 2013
However the printed result is not like what I expected since the server time zone is (UTC+08:00) Kuala Lumpur, Singapore while the user's is (UTC+07:00) Bangkok, Hanoi, Jakarta.
What did I do wrong here ?