Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
deleted 44 characters in body
Source Link
Ahmed Ashour
  • 5.7k
  • 10
  • 41
  • 63
 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");  Date date;  try {   date = dateFormat.parse("2013-12-4");   System.out.println(date.toString()); // Wed Dec 04 00:00:00 CST 2013   String output = dateFormat.format(date);   System.out.println(output); // 2013-12-04  }  catch (ParseException e) {   e.printStackTrace();  } 

It works fine for me.

 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");  Date date;  try {   date = dateFormat.parse("2013-12-4");   System.out.println(date.toString()); // Wed Dec 04 00:00:00 CST 2013   String output = dateFormat.format(date);   System.out.println(output); // 2013-12-04  }  catch (ParseException e) {   e.printStackTrace();  } 

It works fine for me.

DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date; try { date = dateFormat.parse("2013-12-4"); System.out.println(date.toString()); // Wed Dec 04 00:00:00 CST 2013 String output = dateFormat.format(date); System.out.println(output); // 2013-12-04 } catch (ParseException e) { e.printStackTrace(); } 

It works fine for me.

Active reading. Removed meta information (this belongs in comments).
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134
 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date; try { date = dateFormat.parse("2013-12-4"); System.out.println(date.toString()); // Wed Dec 04 00:00:00 CST 2013 String output = dateFormat.format(date);  System.out.println(output); // 2013-12-04 }  catch (ParseException e) { e.printStackTrace(); } 

Thanks for posters. Updated answer and test more. It works fine for me. Have Fun! @.@

 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date; try { date = dateFormat.parse("2013-12-4"); System.out.println(date.toString()); // Wed Dec 04 00:00:00 CST 2013 String output = dateFormat.format(date);  System.out.println(output); // 2013-12-04 } catch (ParseException e) { e.printStackTrace(); } 

Thanks for posters. Updated answer and test more. It works fine for me. Have Fun! @.@

 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date; try { date = dateFormat.parse("2013-12-4"); System.out.println(date.toString()); // Wed Dec 04 00:00:00 CST 2013 String output = dateFormat.format(date); System.out.println(output); // 2013-12-04 }  catch (ParseException e) { e.printStackTrace(); } 

It works fine for me.

added 112 characters in body
Source Link
Luna Kong
  • 3.2k
  • 29
  • 20
 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date; try { date = dateFormat.parse("2013-12-4"); System.out.println(date.toString()); // Wed Dec 04 00:00:00 CST 2013    String output = dateFormat.format(date); System.out.println(output); // 2013-12-04  } catch (ParseException e) { e.printStackTrace(); } 

HaveThanks for posters. Updated answer and test more. It works fine for me. Have Fun! @.@

 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date; try { date = dateFormat.parse("2013-12-4"); System.out.println(date.toString()); // Wed Dec 04 00:00:00 CST 2013 } catch (ParseException e) { e.printStackTrace(); } 

Have Fun! @.@

 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date; try { date = dateFormat.parse("2013-12-4"); System.out.println(date.toString()); // Wed Dec 04 00:00:00 CST 2013    String output = dateFormat.format(date); System.out.println(output); // 2013-12-04  } catch (ParseException e) { e.printStackTrace(); } 

Thanks for posters. Updated answer and test more. It works fine for me. Have Fun! @.@

added 98 characters in body
Source Link
Luna Kong
  • 3.2k
  • 29
  • 20
Loading
deleted 1 characters in body
Source Link
Luna Kong
  • 3.2k
  • 29
  • 20
Loading
Source Link
Luna Kong
  • 3.2k
  • 29
  • 20
Loading