我有这个代码块,其中参数dateFormat.format
将始终是string
那就是为什么我在这里做了.toString()
。我收到错误“无法格式化给定的对象作为日期”。SimpleDateFormat字符串
有没有办法做到这一点?请注意,字符串来自数据库我在这里使用新的Date()作为示例。
SimpleDateFormat dateFormat = new SimpleDateFormat("MMMMM dd, yyyy");
String sCertDate = dateFormat.format(new Date().toString());
目前尚不清楚你想最终达到 – Bozho