提交 4c3575a2 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Minor fixes

上级 0a1aea49
...@@ -691,8 +691,7 @@ public class ToChar { ...@@ -691,8 +691,7 @@ public class ToChar {
output.append(DateTimeUtils.getDayOfYear(dateValue)); output.append(DateTimeUtils.getDayOfYear(dateValue));
i += 3; i += 3;
} else if ((cap = containsAt(format, i, "DD")) != null) { } else if ((cap = containsAt(format, i, "DD")) != null) {
output.append(String.format("%02d", StringUtils.appendZeroPadded(output, 2, dayOfMonth);
dayOfMonth));
i += 2; i += 2;
} else if ((cap = containsAt(format, i, "DY")) != null) { } else if ((cap = containsAt(format, i, "DY")) != null) {
String day = getNames(SHORT_WEEKDAYS)[DateTimeUtils.getSundayDayOfWeek(dateValue)]; String day = getNames(SHORT_WEEKDAYS)[DateTimeUtils.getSundayDayOfWeek(dateValue)];
...@@ -780,7 +779,8 @@ public class ToChar { ...@@ -780,7 +779,8 @@ public class ToChar {
output.append(new DecimalFormat("#,###").format(posYear)); output.append(new DecimalFormat("#,###").format(posYear));
i += 5; i += 5;
} else if ((cap = containsAt(format, i, "SYYYY")) != null) { } else if ((cap = containsAt(format, i, "SYYYY")) != null) {
if (year <= 0) { // Should be <= 0, but Oracle prints negative years with off-by-one difference
if (year < 0) {
output.append('-'); output.append('-');
} }
StringUtils.appendZeroPadded(output, 4, posYear); StringUtils.appendZeroPadded(output, 4, posYear);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论