// TODO: not sure how to handle fractional seconds here
builder.appendSecondOfMinute(2);
break;
default:
throw new EvalException("%O[dHImMUVwWy] not yet implemented");
}
}
break;
case 'S':
// Second as decimal number (00-61), allowing for up to two
// leap-seconds (but POSIX-complaint implementations will ignore
// leap seconds).
// TODO: I have no idea what the docs are talking about in relation
// to leap seconds
builder.appendSecondOfDay(2);
break;
// case 'U':
// Week of the year as decimal number (00-53) using Sunday as
// the first day 1 of the week (and typically with the first
// Sunday of the year as day 1 of week 1). The US convention.
// case 'w':
// Weekday as decimal number (0-6, Sunday is 0).
// case 'W':
// Week of the year as decimal number (00-53) using Monday as
// the first day of week (and typically with the first Monday of
// the year as day 1 of week 1). The UK convention.
// ‘%x’ Date. Locale-specific on output, ‘"%y/%m/%d"’ on input.
//‘%X’ Time. Locale-specific on output, ‘"%H:%M:%S"’ on input.
case 'y':
// Year without century (00-99). Values 00 to 68 are prefixed by
// 20 and 69 to 99 by 19 - that is the behaviour specified by
// the 2004 POSIX standard, but it does also say ‘it is expected
// that in a future version the default century inferred from a
// 2-digit year will change’.
builder.appendTwoDigitYear(1968, true);
break;
case 'Y':
// Year with century
builder.appendYear(1,4);
break;
case 'z':
// Signed offset in hours and minutes from UTC, so ‘-0800’ is 8
// hours behind UTC.
builder.appendTimeZoneOffset(null /* always show offset, even when zero */,
true /* show seperators */,
1 /* min fields (hour, minute, etc) */,
2 /* max fields */ );
break;
case 'Z':
// (output only.) Time zone as a character string (empty if not
// available).
builder.appendTimeZoneName();
break;
default:
throw new EvalException("%" + specifier + " not yet implemented. (Implement me!)");
}
} else {
builder.appendLiteral(patterns.substring(i,i+1));
}
}