Skip to content

Instantly share code, notes, and snippets.

@adsl99801
Last active May 17, 2018 07:58
Show Gist options
  • Select an option

  • Save adsl99801/a9ba5e1a144973051213b0243b085669 to your computer and use it in GitHub Desktop.

Select an option

Save adsl99801/a9ba5e1a144973051213b0243b085669 to your computer and use it in GitHub Desktop.
JSR3310
String now = "2009-10-01T00:00";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm");
LocalDateTime formatDateTime = LocalDateTime.parse(now, formatter);
System.out.println("formatDateTime:"+formatDateTime.toString());
DateTimeFormatter f2 = DateTimeFormatter.ofPattern("yyyyMMdd");
String str1 = formatDateTime.format(f2);
System.out.println("str1:"+str1);
assertTrue(true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment