<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[HeyJYS的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/HeyJYS</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; HeyJYS]]></copyright><item><title><![CDATA[Java中日期的转换（String, Date, Long）]]></title><link>https://blog.youkuaiyun.com/HeyJYS/article/details/107022380</link><guid>https://blog.youkuaiyun.com/HeyJYS/article/details/107022380</guid><author>HeyJYS</author><pubDate>Mon, 29 Jun 2020 16:27:28 +0800</pubDate><description><![CDATA[一.string，long和Date类型的转换


SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

try {
        String d1 = "2020-9-29";
        Date d11 = sdf.parse(d1); // string ---&gt; date
        System.out.println(sdf.format(d11)); // date ---&gt; string

     ]]></description><category></category></item></channel></rss>