java – 如何将日期转换为UTC
发布时间:2020-12-15 02:03:46 所属栏目:Java 来源:网络整理
导读:我需要将日期格式更改为UTC格式. File file = new File(); … file.lastModified(); 我需要以UTC格式转换文件的lastModified日期. 解决方法 String lv_dateFormateInUTC=""; //Will hold the final converted date SimpleDateFormat lv_formatter = new Simp
我需要将日期格式更改为UTC格式.
…
我需要以UTC格式转换文件的lastModified日期. 解决方法String lv_dateFormateInUTC=""; //Will hold the final converted date SimpleDateFormat lv_formatter = new SimpleDateFormat(); lv_formatter.setTimeZone(TimeZone.getTimeZone("UTC")); lv_dateFormateInUTC = lv_formatter.format(lv_localDate); 像这样…… !! (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |