使用SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
sdf.parse(strDate);如果成功返回就是正确的string了
sdf.parse(strDate);如果成功返回就是正确的string了
解决方案 »
- 如何不让搜索引擎收录
- struts2批量上传文件问题,每个目录对应一张图片,目录是数据库取的,数量不定,所以上传文件数量也不一定,怎么知道上传的文件对应哪个目录呢?
- web.xml配置servlet问题
- 哪个GG有开源的CRM,最好是JAVA写的
- strust1.2 文件下载问题
- 求助:怎样获取页面参数?
- MyEclipse的问题
- 关于JDBC的一个问题
- 在XP系统下怎么安装tomcat 和JDK?环境变量怎么设置?
- 到一定条件后,怎么在jsp中达停止输出,不在执行后面的语句
- 谁帮我看看一点小问题,急!!在线等(马上结帖)
- word文档存在oracle的blob字段中,如何用jsp在网页中把woer文档打开
你的是什么jdk??public Date parse(String text,
ParsePosition pos)
Parses text from a string to produce a Date.
The method attempts to parse text starting at the index given by pos. If parsing succeeds, then the index of pos is updated to the index after the last character used (parsing does not necessarily use all characters up to the end of the string), and the parsed date is returned. The updated pos can be used to indicate the starting point for the next call to this method. If an error occurs, then the index of pos is not changed, the error index of pos is set to the index of the character where the error occurred, and null is returned.
全去的话可以用replace,把空格替换成空字符