Java Orientdb读取错误的时间
我将Orientdb与Eclipse和Orientdb客户机jar一起使用。我使用以下语句来读出信息:Java Orientdb读取错误的时间,java,orientdb,Java,Orientdb,我将Orientdb与Eclipse和Orientdb客户机jar一起使用。我使用以下语句来读出信息: List<ODocument> result = connection.command( new OSQLSynchQuery<ODocument>( "SELECT * FROM Message")) .execute(); 那么为什么约会的时间不同(2小
List<ODocument> result = connection.command(
new OSQLSynchQuery<ODocument>(
"SELECT * FROM Message"))
.execute();
那么为什么约会的时间不同(2小时)?这可能是时区问题吗?因为数据库返回的结果是数据库的时区问题。
您可以在studio的Db->configuration部分看到它。
更新时区的命令如下所示
alter database timezone GMT+6
对我来说,解决方案是GMT+2。谢谢
DateFormat formatter = new SimpleDateFormat("HH:mm:ss a");
String time = formatter.format(each.field("Time"));