心情 天空

 




 










访




R
S
S

我的 Blog:
jybbh 最新的 20 条日志
[Ken的日志]
[工作心得]
[编程相关]
[潮汕文化]
[计算机相关]
[WEB相关]
[JAVA相关]
[Eclipse相关]
[Tomcat相关]
[SQL]
全站 Blog:
全站最新的 20 条日志

字符类型 String 怎样转换成 日期类型 Date?

   编程相关2005-4-14 0:22
//format pattern
String pattern = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat formater = new SimpleDateFormat(pattern);

//Date -> String :
Date date1 = new Date();
String str1 = formater.format(date1);

//String ->Date
String str2 = "2003-10-18 13:15:45";
Date date2 = formater.parse(str2);

标签集:TAGS:
回复Comments()点击Count()

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}
 

Copyright 2004 酷酷小家园   Powered by 5dblog