Date is deprecated, and I think it would be better to use DateTimeFormatter in Java 8~
String string = "January 2, 2010";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMMM d, yyyy", Locale.ENGLISH);
LocalDate date = LocalDate.parse(string, formatter);
System.out.println(date); // 2010-01-02
I use it like this
623 Uncaught (inpromise) Error on Electron: An object could not be cloned
584 PHP ssh2_scp_send fails to send files as intended
922 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.