Ver código fonte

FieldName精确到毫秒

luozhipeng 1 ano atrás
pai
commit
5b9bff472d

+ 2 - 3
compdfkit-tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfstyle/CPDFGlobalAnnotStyle.java

@@ -469,9 +469,8 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
     }
 
     protected String getDefaultFiledName(String widgetType) {
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        Date date = new Date(System.currentTimeMillis());
-        String dateStr = simpleDateFormat.format(date);
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+        String dateStr = df.format(new Date());
         return String.format("%s%s", widgetType, dateStr);
     }
 }