如何Timzones转换的双 [英] How to convert Timzones in Double
本文介绍了如何Timzones转换的双的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谁能告诉我如何在双获得Timzones,其实我得到时区像这样 UTC + 5.30
不过,我想只有5.30 在双帮我急了我。
Can anyone tell me how to get Timzones in double, actually I get timezone like this way UTC+5.30
But I Want only 5.30 in double please help me its urgent for me.
推荐答案
尝试
TimeZone tz = TimeZone.getDefault();
String gmt = TimeZone.getTimeZone(tz.getID()).getDisplayName(false,
TimeZone.SHORT);
String z1 = gmt.substring(4);
String z = z1.replaceAll(":", ".");
double zo = Double.parseDouble(z);
Log.d("double time", "" + zo);
这篇关于如何Timzones转换的双的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文