提交 8f5c5e50 authored 作者: Thomas Mueller's avatar Thomas Mueller

The MySQL compatibility extension fromUnixTime now used the English locale.

上级 0344e072
......@@ -18,7 +18,8 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>When using LOG=2 and repeatedly updating the last row rows of a table, the index file grew quickly.
<ul><li>The MySQL compatibility extension fromUnixTime now used the English locale.
</li><li>When using LOG=2 and repeatedly updating the last row rows of a table, the index file grew quickly.
</li><li>In versions 1.1.105 and 1.1.106, encrypted script files of earlier versions could not be processed.
This is now again possible. The problem was that such script files were stored in a special format
(STORAGE=TEXT) but support for this format was removed in version 1.1.105.
......
......@@ -11,6 +11,7 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import org.h2.util.StringUtils;
......@@ -112,7 +113,7 @@ public class FunctionsMySQL {
* @return a formatted date/time String in the format "yyyy-MM-dd HH:mm:ss".
*/
public static String fromUnixTime(int seconds) {
SimpleDateFormat formatter = new SimpleDateFormat(DATE_TIME_FORMAT);
SimpleDateFormat formatter = new SimpleDateFormat(DATE_TIME_FORMAT, Locale.ENGLISH);
return formatter.format(new Date(seconds * 1000L));
}
......@@ -126,7 +127,7 @@ public class FunctionsMySQL {
*/
public static String fromUnixTime(int seconds, String format) {
format = convertToSimpleDateFormat(format);
SimpleDateFormat formatter = new SimpleDateFormat(format);
SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.ENGLISH);
return formatter.format(new Date(seconds * 1000L));
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论