我是靠谱客的博主 端庄鱼,这篇文章主要介绍字符串日期format,现在分享给大家,希望可以做个参考。

1.
String data = "1234-12-31 12:34:56";
DateTime dt = new DateTime(data,"yyyy-MM-dd HH:mm:ss");
2.
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, -6);
sdf.format(c.getTime());

最后

以上就是端庄鱼最近收集整理的关于字符串日期format的全部内容,更多相关字符串日期format内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(57)

评论列表共有 0 条评论

立即
投稿
返回
顶部