首先 Mon Dec 09 22:06:24 格林尼治标准时间+0800 2013 字段一个格林尼治标准时间时间,一般情况下字段中不会含有中文,对于这种格式有两种解决方法

1剔除中文字符串

public static String convertGMTToLoacale(String gmt){
String cc = gmt.substring(0, 19) + gmt.substring(33, 38);
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy",new Locale("English"));
try {
Date date = sdf.parse(cc);
SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM");
String result = dateformat.format(date);
return result;
} catch (ParseException e) {
}
return "";
}

2.第二种方法是在不进行字符串剔除的情况下:

在simpleDateFormat方法中将格式字符串变换为:"EEE MMM dd HH:mm:ss 格林尼治标准时间+0800 yyyy" 就可以了。这样就可一将时间转换为Date类型:
private DateFormat format = new SimpleDateFormat("EEE MMM dd HH:mm:ss 格林尼治标准时间+0800 yyyy",Locale.ENGLISH);

更多相关文章

  1. 分支和循环(二)(零基础学习C语言)
  2. Android学习:TextUtils类介绍
  3. android之View的启动过程
  4. 毫秒级别时间戳转换
  5. Android开发指南(41) —— Searchable Configuration
  6. Android:Date、String、Long三种日期类型之间的相互转换
  7. *Android闹钟原理
  8. Android启动Activity的标准Action和标准Category
  9. 如何判断是手机端还是PC端?

随机推荐

  1. android 手电筒demo
  2. android Thread和Runnable的区别
  3. android 古怪问题解决集合
  4. Android动态改变TextView字体颜色
  5. android 获取IP
  6. Android圆形进度条
  7. android NinePatchDrawable 9.png图片使
  8. android 怎样用代码设置墙纸
  9. android使用属性动画执行抖动效果
  10. Android:管理应用内存