Sending a date and timezone from GAE server to GWT client

前端 未结 2 2110
一向
一向 2020-12-31 22:18

OK folks, I have been going around this problem for about 2 weeks now trying everything I can think of and looking at tons of answers on here that feel like they are going t

2条回答
  •  执念已碎
    2020-12-31 23:04

    I have a similar issue with v2.4.

    I think Riley Lark is right.

    TimeZone.createTimeZone("Asia/Tokyo") did not work in GWT 2.4

    However, I found I could get the Tokyo zone by using the browser's default setting via:

    Date d = new Date();
    TimeZone timezone = TimeZone.createTimeZone(d.getTimezoneOffset());
    

    That is really what Riley Lark is suggesting for you since europeLondon has "std_offset": 0...

    TimeZone timezone = TimeZone.createTimeZone(0);

提交回复
热议问题