public CharSequence GetUTCTime() {
  Calendar cal = Calendar.getInstance(Locale.CHINA);
  int zoneOffset = cal.get(java.util.Calendar.ZONE_OFFSET);
  int dstOffset = cal.get(java.util.Calendar.DST_OFFSET);
  cal.add(java.util.Calendar.MILLISECOND, -(zoneOffset + dstOffset));
  return DateFormat.format("yyyy'-'MM'-'dd'T'kk':'mm':'ss'Z'", cal);


主要用到的类:java.util.Calendar和android.text.format.DateFormat

  SimpleDateFormat sdf = new SimpleDateFormat("yy/MM/dd hh:mm:ss");
	    sdf.setTimeZone(TimeZone.getTimeZone("gmt"));
	    String gmtTime = sdf.format(date);
	    tvDate.setText(gmtTime);
第一种:public CharSequence GetUTCTime() { Calendar cal = Calendar.getInstance(Locale.CHINA); int zoneOffset = cal.get(java.util.Calendar.ZONE_OFFSET); int dstOffset = cal.get(java.util.Calenda long utc1=Long.parseLong(utc); long utc2=1400000000L;//自己的偏移量  long utcz=(utc1+utc2)*1000; public static String getFormatedDa public static String Local2UTC(){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); sdf.setTimeZone(TimeZone.get
public static String getUTCFromLocalTime_(int hour, int minute, int second) { StringBuffer UTCTimeBuffer = new StringBuffer(); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:...
1,布局用到 <com.handmark.pulltorefresh.library.PullToRefreshListView" /> 需要导外部包插件 pulltorefresh_library 用到的权限: public class Main { public static void main(String[] args) { LocalDateTime currentTime = LocalDateTime.now(ZoneOffset.UTC); System.out.println(currentTime); 这样就能够获取当前的UTC时间了。希望能够帮到您! MySQL5.7执行mysqld命令出现Can‘t change dir to ‘C:\Program Files\MySQL\MySQL Server 5.7\data\‘错误 19276 MySQL5.7执行mysqld命令出现Can‘t change dir to ‘C:\Program Files\MySQL\MySQL Server 5.7\data\‘错误 神明不渡众生苦.: 本来就有一个data文件夹 重建了一个 还是报错啊 MySQL5.7执行mysqld命令出现Can‘t change dir to ‘C:\Program Files\MySQL\MySQL Server 5.7\data\‘错误 Ring0814: undefined Centos6.9安装JDK1.8 rel~smart: 不错挺好的