}
case DateTime.AM_PM: { // 'p' (am or pm)
// Calendar.AM = 0, Calendar.PM = 1, LocaleElements defines upper
String[] ampm = { "AM", "PM" };
if (l != null && l != Locale.US) {
DateFormatSymbols dfs = DateFormatSymbols.getInstance(l);
ampm = dfs.getAmPmStrings();
}
String s = ampm[t.get(Calendar.AM_PM)];
sb.append(s.toLowerCase(l != null ? l : Locale.US));
break;
}
case DateTime.SECONDS_SINCE_EPOCH: { // 's' (0 - 99...?)
long i = t.getTimeInMillis() / 1000;
Flags flags = Flags.NONE;
sb.append(localizedMagnitude(null, i, flags, width, l));
break;
}
case DateTime.SECOND: { // 'S' (00 - 60 - leap second)
int i = t.get(Calendar.SECOND);
Flags flags = Flags.ZERO_PAD;
sb.append(localizedMagnitude(null, i, flags, 2, l));
break;
}
case DateTime.ZONE_NUMERIC: { // 'z' ({-|+}####) - ls minus?
int i = t.get(Calendar.ZONE_OFFSET);
boolean neg = i < 0;
sb.append(neg ? '-' : '+');
if (neg)
i = -i;
int min = i / 60000;
// combine minute and hour into a single integer
int offset = (min / 60) * 100 + (min % 60);
Flags flags = Flags.ZERO_PAD;
sb.append(localizedMagnitude(null, offset, flags, 4, l));
break;
}
case DateTime.ZONE: { // 'Z' (symbol)
TimeZone tz = t.getTimeZone();
sb.append(tz.getDisplayName((t.get(Calendar.DST_OFFSET) != 0),
TimeZone.SHORT,
l));
break;
}
// Date
case DateTime.NAME_OF_DAY_ABBREV: // 'a'
case DateTime.NAME_OF_DAY: { // 'A'
int i = t.get(Calendar.DAY_OF_WEEK);
Locale lt = ((l == null) ? Locale.US : l);
DateFormatSymbols dfs = DateFormatSymbols.getInstance(lt);
if (c == DateTime.NAME_OF_DAY)
sb.append(dfs.getWeekdays()[i]);
else
sb.append(dfs.getShortWeekdays()[i]);
break;
}
case DateTime.NAME_OF_MONTH_ABBREV: // 'b'
case DateTime.NAME_OF_MONTH_ABBREV_X: // 'h' -- same b
case DateTime.NAME_OF_MONTH: { // 'B'
int i = t.get(Calendar.MONTH);
Locale lt = ((l == null) ? Locale.US : l);
DateFormatSymbols dfs = DateFormatSymbols.getInstance(lt);
if (c == DateTime.NAME_OF_MONTH)
sb.append(dfs.getMonths()[i]);
else
sb.append(dfs.getShortMonths()[i]);
break;
}
case DateTime.CENTURY: // 'C' (00 - 99)
case DateTime.YEAR_2: // 'y' (00 - 99)
case DateTime.YEAR_4: { // 'Y' (0000 - 9999)