I want to display the current month, date, year and time.
I have a .jsp file which has the following code inside:
SimpleDateFormat format = new SimpleDateFormat("MMM dd,yyyy hh:mm");
String date = format.format(new Date());
??? 13,2016 04:14
10 13,2016 04:17
??????? 13,2016 04:18
SimpleDateFormat("MMM dd,yyyy hh:mm",Locale.US).
If you are trying to print date in a foriegn locale (or if your locale seems to be wrong), you can change change it in your environment so that it can generate the name of the month correctly.
You can set your system locale in Windows using control panel like
Start->Control Panel->Clock,Language and Region like shown here. You can also change locale per user as discussed in this detailed FAQ
If you are on linux, you can set your locale in system configuration OR in your HOME directory as discussed here