I need to get the field AM/PM in date object. How can i get it?
This is my code.
String startTime =\"01:05 PM\"; SimpleDateFormat sdf = new SimpleDa
Calendar can also do
Calendar cal = Calendar.getInstance(); cal.setTime(st); String meridiem = cal.getDisplayName(Calendar.AM_PM, Calendar.SHORT, Locale.getDefault())
meridiem now equals "PM" based on your code.
meridiem