现在有个字符串是这样的20120520152345代表时间是 2012年5月20日15点23分45秒怎么能转换成2012-05-20 15:23:45呢?Java
解决方案 »
- 大神们帮看下这段代码的意思的,好像是关于google邮件stmp的验证,但不懂是什么意思
- java正则表达式的一个问题(?:),高手来解答一下
- 怎么返回类型
- you have an error in your sql syntax;check the manual
- 如何用servlet区分删除,修改参数
- 问题不难,可也找过很多高手都没解决,关于一个list的传输
- 小弟马上就要论文开题了,但是没有什么头绪,请各位前辈指点!
- apache与tomcat通过JK2整合后的URI映射问题.
- 有谁知道veritas的insight、indepth和inform工具
- java scoket怎么传输自定义协议
- hibernate list() 空指针
- ssh的问题
String source = "20120520152345";
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
String result = sdf1.format(sdf.parse(source));
System.out.println(result);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}