Changeset 7828


Ignore:
Timestamp:
Jun 18, 2020, 8:20:57 AM (20 months ago)
Author:
Nicklas Nordborg
Message:

References #2215: Change history is logging timestamp values incorrectly

Found two more places that used 'hh'. One in the test code for Excel functionality and one in the FlatFileParser when handling Excel files. I could not get them to cause any problems. It seems like Excel is smart enough to let 'hh' mean 24-hour format if no AM/PM marker is found in the template.

I also found a few unused code lines in the Values class and removed them.

Location:
branches/3.16-stable/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.16-stable/src/core/net/sf/basedb/util/Values.java

    r7168 r7828  
    2323package net.sf.basedb.util;
    2424
    25 import java.text.SimpleDateFormat;
    2625import java.util.Date;
    2726import java.util.regex.Pattern;
     
    688687    return bytes;
    689688  }
    690  
    691  
    692   private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
    693   private static final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("HH:mm:ss");
    694   private static final SimpleDateFormat DATETIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    695 
    696689
    697690  /**
  • branches/3.16-stable/src/core/net/sf/basedb/util/parser/FlatFileParser.java

    r7738 r7828  
    701701   
    702702    * If no date format has been specified, yyyy-MM-dd is used
    703     * If no timestamp format has been specified, yyyy-MM-dd hh:mm:ss is used
     703    * If no timestamp format has been specified, yyyy-MM-dd HH:mm:ss is used
    704704    * If no number format has been specified, 'dot' is used
    705705    * The data splitter regular expression is changed to \\t
     
    722722      excelWorkbook = new XlsxToCsvUtil();
    723723      if (dateFormat == null) dateFormat = new DateFormatter("yyyy-MM-dd");
    724       if (timestampFormat == null) timestampFormat = new DateFormatter("yyyy-MM-dd hh:mm:ss");
     724      if (timestampFormat == null) timestampFormat = new DateFormatter("yyyy-MM-dd HH:mm:ss");
    725725      if (numberFormat == null) numberFormat = NumberFormatUtil.getNumberFormat('.', (char)0);
    726726      excelWorkbook.setDateFormat(dateFormat);
  • branches/3.16-stable/src/test/TestExcelFunctions.java

    r7728 r7828  
    129129      tw.setColumnFormatter(3, new NumberFormatter(2, true));
    130130      tw.setColumnFormatter(4, new DateFormatter("yyyy-MMM-dd"));
    131       tw.setColumnFormatter(5, new DateFormatter("yyyy-MMM-dd hh:mm"));
     131      tw.setColumnFormatter(5, new DateFormatter("yyyy-MMM-dd HH:mm"));
    132132     
    133133      data[0] = "Bar code";
Note: See TracChangeset for help on using the changeset viewer.