I receive DATETIME from mysql database in a format like this 2016-10-12 18:52:00. Is there an easy way to print it in a readable like 12 October 2016 6:52 pm in java or android?
Asked
Active
Viewed 1,599 times
-3
-
Have a look around theres plenty of similar questions on SO http://stackoverflow.com/questions/10621451/how-to-convert-from-java-sql-timestamp-to-java-util-date. – beaumondo Nov 20 '16 at 09:54
-
https://developer.android.com/reference/java/text/SimpleDateFormat.html – j.kaspar Nov 20 '16 at 09:55
1 Answers
0
You can do things like:
SimpleDateFormat simpleDate = new SimpleDateFormat("MM/DD/YYYY HH:mm:ss");
Date date = new Date();
String S = simpleDate.format(date); //This will give you like 11/20/2016 08:45:02
Now use this form and get the month name programatically according to your need.

Swr7der
- 849
- 9
- 28