【发布时间】:2013-12-26 17:54:21
【问题描述】:
我正在使用以下函数来格式化日期时间
FormatDateTime(UniversalIndexingPage.DateOfDocument, "DD-MON-YY", "", "")
但是我在日志中收到以下错误
|10.67.60.74 - Cannot create format "DD-MON-YY"
java.lang.IllegalArgumentException: Illegal pattern character 'O'
at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:768)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:575)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:500)
at com.pega.ibm.icu.impl.pega.LocaleElements.getSimpleDateFormat(LocaleElements.java:975)
at com.pega.ibm.icu.text.SimpleDateFormat.<init>(SimpleDateFormat.java:93)
at com.pega.pegarules.pub.util.PRDateFormat.createRealFormat(PRDateFormat.java:1544)
at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
请帮忙!
【问题讨论】:
-
您对错误有什么不明白的地方?我不认为它会更清楚。
-
为什么说非法模式字符'O'
-
因为
O在您的格式中是非法字符。 -
你想要 dd-MM-yyyy 我怀疑...或者 dd-MM-yy 如果你真的想要两位数的年份。
-
但是没有编译错误,UI也没有错误,但是Log中产生了错误