Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用此代码获取今天的日期并显示它
m_today = Calendar.getInstance();
现在我怎样才能得到下一个 3 个月的日期?像这样的东西:
2012 年 11 月 21 日至 2013 年 2 月 21 日
我可以显示第一部分,但如何显示第二部分?
这应该工作,
Calendar cal = Calendar.getInstance(); //Get the Calendar instance cal.add(Calendar.MONTH,3);//Three months from now cal.getTime();// Get the Date object
m_today.add(Calendar.MONTH, 3);