-
创建时间
20年3月31日
-
最后回复
20年3月31日
-
1
回复
-
858
浏览
-
1
用户
自己做了强制转换:
/**
* LeanCloud的Date转能使用的Date
* 入参string:
* * LeanCloud:Tue Mar 31 11:07:44 GMT+08:00 2020
* * Gson把LeanCloud格式变成: Mar 31, 2020 11:07:44 不可本地使用
* * 所以要转化一下
* @param string
* @return
*/
public static Date leancloudDateStringToDate(String string) {
//SimpleDateFormat sdf = new SimpleDateFormat("MMM d, yyyy K:m:s a", Locale.ENGLISH);
SimpleDateFormat sdf = new SimpleDateFormat("MMM d, yyyy K:m:s", Locale.ENGLISH);
Date d2 = null;
try {
d2 = sdf.parse(string);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println("d2 ====== "+d2);
return d2;
}
推荐主题
主题 | 分类 | 回复 | 浏览 | 活动 |
---|---|---|---|---|
Python SDK安装失败报错 | SDK / API | 4 | 976 | 21-03-3 |
调用[LCRouter appURLForPath:appID:]的时候发生闪退现象 | SDK / API | 2 | 1.5K | 19-01-2 |
短信签名审核无法通过 | SDK / API | 3 | 916 | 22-06-6 |
请问用leancloud可以实现朋友圈的功能吗? | SDK / API | 0 | 790 | 16-04-21 |
app在后台的时候im如何激活长链接 | SDK / API | 0 | 773 | 16-05-27 |