小编Fab*_*tch的帖子

Java Date 获取真实偏移量

我想获得时区的真实偏移量。

我的问题 :

 TimeZone tz = TimeZone.getTimeZone("America/Toronto");
int test = tz.getRawOffset();

test = -18000000

-18000000/1000/3600 = -5 
Run Code Online (Sandbox Code Playgroud)

或者如果我去https://www.google.fr/search?q=horaire+toronto&oq=horaire+toro&aqs=chrome.1.69i57j0l5.3311j0j7&sourceid=chrome&ie=UTF-8

我看到多伦多的时间是 UTC-4。

它在文档中写道,该方法返回原始偏移量。

但我怎样才能得到真正的偏移量呢?

java date

2
推荐指数
1
解决办法
335
查看次数

标签 统计

date ×1

java ×1