如何在orientdb中添加天数
how to add days in orient db
我们如何向 Orient db 中的日期添加天数?
select sysdate()+1 from safetyplan;
它给出与 sysdate() 相同的输出。
1 没有被添加。你能帮帮我吗?
根据 Orientdb 文档 2.2:
sysdate() returns the current date time. If executed with no parameters, it
returns a Date object, otherwise a string with the requested
format/timezone.
因此,一种可能的方法是使用日期的 .asLong() 方法将日期对象转换为 long object.Then 执行必要的 addition.Convert 使用 .asDate() 方法将其返回到日期。
示例:要将一天添加到当前日期,请使用:
select sum(sysdate().asLong(),86400000).asDate() from safetyplan;
注意:我们添加的是毫秒和 1 天=1000*60*60*24 毫秒
注意:认为这个答案可能对某人有所帮助,很抱歉回答我自己的问题。
我们如何向 Orient db 中的日期添加天数?
select sysdate()+1 from safetyplan;
它给出与 sysdate() 相同的输出。 1 没有被添加。你能帮帮我吗?
根据 Orientdb 文档 2.2:
sysdate() returns the current date time. If executed with no parameters, it returns a Date object, otherwise a string with the requested format/timezone.
因此,一种可能的方法是使用日期的 .asLong() 方法将日期对象转换为 long object.Then 执行必要的 addition.Convert 使用 .asDate() 方法将其返回到日期。
示例:要将一天添加到当前日期,请使用:
select sum(sysdate().asLong(),86400000).asDate() from safetyplan;
注意:我们添加的是毫秒和 1 天=1000*60*60*24 毫秒
注意:认为这个答案可能对某人有所帮助,很抱歉回答我自己的问题。