您的位置:首页 > 编程语言 > Java开发

The Constructor Date(String) is Deprecated since of JDK 1.1 you should not use it

2010-11-20 11:22 429 查看

The Constructor Date(String) is Deprecated since of JDK 1.1 you should not use it

You should use java.text.SimpleDateFormat to convert String value to Date. E.g.

1

private

static

final

SimpleDateFormat sdf =

new

SimpleDateFormat(”yyyy-MM-dd”);

2

String birthDate = “

1981

-

12

-

30

?;

3

Date birth = sdf.format(birthDate);

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐