\r
package org.apache.poi.ss.formula.functions;\r
\r
+import java.util.Locale;\r
+\r
import org.apache.poi.ss.formula.OperationEvaluationContext;\r
import org.apache.poi.ss.formula.eval.ErrorEval;\r
import org.apache.poi.ss.formula.eval.EvaluationException;\r
if (suffixValue.length() == 0) {\r
suffixValue = DEFAULT_SUFFIX;\r
}\r
- if (suffixValue.equals(DEFAULT_SUFFIX.toUpperCase()) || suffixValue.equals(SUPPORTED_SUFFIX.toUpperCase())) {\r
+ if (suffixValue.equals(DEFAULT_SUFFIX.toUpperCase(Locale.ROOT)) || \r
+ suffixValue.equals(SUPPORTED_SUFFIX.toUpperCase(Locale.ROOT))) {\r
return ErrorEval.VALUE_INVALID;\r
}\r
if (!(suffixValue.equals(DEFAULT_SUFFIX) || suffixValue.equals(SUPPORTED_SUFFIX))) {\r
/**
* Contains methods for dealing with Excel dates.
- *
- * @author Michael Harhen
- * @author Glen Stampoultzis (glens at apache.org)
- * @author Dan Sherman (dsherman at isisph.com)
- * @author Hack Kampbjorn (hak at 2mba.dk)
- * @author Alex Jacoby (ajacoby at gmail.com)
- * @author Pavel Krupets (pkrupets at palmtreebusiness dot com)
- * @author Thies Wellpott
*/
public class DateUtil {
protected DateUtil() {
int month = parseInt(monthStr, "month", 1, 12);
int day = parseInt(dayStr, "day", 1, 31);
- Calendar cal = new GregorianCalendar(year, month-1, day, 0, 0, 0);
+ Calendar cal = new GregorianCalendar(TIMEZONE_UTC, Locale.ROOT);
+ cal.set(year, month-1, day, 0, 0, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
}