SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
TimeZone pst = TimeZone.getTimeZone("Etc/GMT-8");
Date curDate = new Date(System.currentTimeMillis());
formatter.setTimeZone(pst);
String curTime = formatter.format(curDate).replace(" ", "");
Log.i(TAG, "curTime:"+curTime);GMT-8为北京时间
版权声明:本文为fabbychips原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。