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 is probably best, but you could use DateFormat, too:
String amPm = new SimpleDateFormat("aa").format(time);
The TimeZone caveat also applies here.