0

我知道 System.currentTimeMillis() 给出了从纪元(1970 年 1 月 1 日,格林威治标准时间 00:00:00)经过的毫秒数。但是我需要一个解决方案来找到从 1970 年 1 月 1 日、00:00:00 IST 或任何其他时区开始的毫秒数。

4

2 回答 2

1

将 转换Calendar为 IST 时区并通过调用比较值Calendar.getTimeInMillis();

请通过以下链接转换为时区。时区转换

于 2012-05-11T10:25:00.767 回答
0

这是一种获取特定区域时间的方法:

DateTimeZone tz = DateTimeZone.forID("America/Winnipeg");
DateTime dt = new DateTime(tz);
DateFormat df = DateFormat.getDateInstance();
df.format(dt.getTime());

可以在此站点上找到 ID 。

于 2012-05-11T10:28:08.070 回答