I have dates like -
15-JUL-10 00:00:00
12-AUG-10 23:59:59
24-SEP-10 18:13:18
How to easily parse these dates and assign a Date object?
Using java.text.SimpleDateFormat:
java.text.SimpleDateFormat
DateFormat df = new SimpleDateFormat("dd-MMM-yy HH:mm:ss"); df.parse(dateString);
Use SimpleDateFormat .
DateFormat fmt = new SimpleDateFormat("dd-MMM-yy HH:mm:ss"); Date date = fmt.parse("15-JUL-10 00:00:00");
Source: https://habr.com/ru/post/1770395/More articles:Android: UnknownHostException when sending HTTP POST - androidC #: beginners constructor problems CLASS - constructorSystem.Drawing.Color in Javascript - c #How to eliminate bottlenecks for reconfiguring host + device memory in OpenCL / CUDA - memoryBlockingCollection + UI Thread - c #highlight column - jqueryParsing dates in Java? - javaA strongly typed generic method calls the base class method of the argument, not the shadow method in T? - genericsThe right way to maintain an advanced multimedia database for Android a la MediaStore? - androidThe best way to transfer data from one database (sql server 2008) to another db (sql server 2008) with another schema is synchronizationAll Articles