首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

将字符串变换为指定格式的日期类型

2012-08-31 
将字符串转换为指定格式的日期类型SimpleDateFormat dateFormat new SimpleDateFormat(yyyy-MM)Date d

将字符串转换为指定格式的日期类型
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM")
Date date = dateFormat.parse(str);

此方法会抛出异常 还要try catch 下

热点排行