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.
我的输入格式是JAVA Sep 22, 2008,如何将其转换为9/22/2008JAVA?
Sep 22, 2008
9/22/2008
这样做
Date date = new SimpleDateFormat("MMM d, yyyy").parse("Sep 22, 2008"); String formattedDate = new SimpleDateFormat("MM/dd/yyyy").format(date); System.out.println(formattedDate);
输出
09/22/2008