[英]How to find number of milliseconds that have elapsed from a timestamp in local/any timezone in java
I know that System.currentTimeMillis() gives the number of milliseconds that have elapsed from epoch(1 Jan 1970, 00:00:00 GMT). 我知道System.currentTimeMillis()给出了从纪元(1970年1月1日,格林尼治标准时间00:00:00)过去的毫秒数。 But I need a solution to find the number of milliseconds that have elapsed from say 1 Jan 1970, 00:00:00 IST or any other timezone in general. 但是,我需要一个解决方案来查找从1970年1月1日IST 00:00:00 IST或一般任何其他时区过去的毫秒数。
Convert the Calendar
to the IST timezone and compare the values by calling Calendar.getTimeInMillis();
将Calendar
转换为IST时区,并通过调用Calendar.getTimeInMillis();
比较值Calendar.getTimeInMillis();
Please go through the below link for converting to TimeZones. 请通过以下链接转换为TimeZones。 TimeZone Conversion 时区转换
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.