惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
B
Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
Google DeepMind News
Google DeepMind News
U
Unit 42
雷峰网
雷峰网
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
美团技术团队
Y
Y Combinator Blog
腾讯CDC
B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements

博客园 - 晨月

思恋 Google打不开的解决方法和IP地址表 Reporting service 中文参数问题的解决办法 BI项目技术资料 java根据网卡取本机配置的IP - 晨月 - 博客园 文本框输入限制 [大全] - 晨月 - 博客园 应用HttpClient来对付各种顽固的WEB服务器 不得不看的几个经典网站 运行 bat(批处理) 文件 谈谈JAVA程序的反编译 Oracle SQL FAQ df zt() 男人25岁之前必须懂得21个道理 爱有多销魂就有多伤人 javascript 实现多级联动 众里寻他千百度,蓦然回首,那人却在,灯火阑珊处 学习的一个过程 google高手必经之路 正则表达式小技巧
一个如何从某一天格式(2005-12-31)得到该天的下一天格式(20...
晨月 · 2005-06-24 · via 博客园 - 晨月
 

public static String getNextDate(String sdf,String dateString) {
        Calendar now_Time = Calendar.getInstance();
        DateFormat df=new SimpleDateFormat(sdf);
        try {
            now_Time.setTime(df.parse(dateString));
        } catch (ParseException e) {
            // TODO 自动生成 catch 块
            e.printStackTrace();
        }
        now_Time.add(Calendar.DATE,1);
        SimpleDateFormat sdNowDate = new SimpleDateFormat(sdf);
        return sdNowDate.format(now_Time.getTime());
    }

TEST:
getNextDate("yyyy-MM-dd","2005-12-31")
RESULT:
2006-01-01