如果有人试图在这里找到答案(就像我一样),这就是解决问题的方法:
String getServerTime() { Calendar calendar = Calendar.getInstance(); SimpleDateFormat dateFormat = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss z", Locale.US); dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); return dateFormat.format(calendar.getTime());}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)