我正在尝试将当前UTC时间上传到Parse中的日期“字段”。我怎样才能做到这一点?
DateFormat df = DateFormat.getTimeInstance();
df.setTimeZone(TimeZone.getTimeZone("utc"));
String utcTime = df.format(new Date());
message.put("lastReplyUpdatedAt", utcTime);
message.saveInBackground();
不幸的是,我似乎无法正确导入上述类中的类,因此无法构造String。我在这里可以做什么?另外,我不确定Parse是否会接受该String。有什么我需要考虑的特殊格式吗?
Date
从Parse平台文档中,传递一个Date
对象而不是一个String。
Date myDate = new Date();
message.put("lastReplyUpdatedAt", myDate);
message.saveInBackground();
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句