解析时的java日期问题 [英] java date problem in parsing
本文介绍了解析时的java日期问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在解析一个日期,在那里我经过 2011-02-10 00:00:00:0
,而我正在获得 2011 -01-10
作为结果。这是错的吗请帮忙。
I am parsing a date, where I am passing 2011-02-10 00:00:00:0
, and I am getting 2011-01-10
as the result. Is this wrong? Please help.
DateFormat df = new SimpleDateFormat("yyyy-mm-dd");
today = df.parse(datecollection);
推荐答案
月的模式是MM:yyyy-MM- dd。您应阅读API doc 。
The pattern for month is MM: yyyy-MM-dd. You should read the API doc.
这篇关于解析时的java日期问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文