当我们使用此查询
时> db.system.js.save( { _id : "function1", value : my_function } );
输出
select '2930:41:51.974223'::interval(0);
所需输出
2930:42
我试过
interval
------------
2930:41:52
结果:
select to_char('2930:41:51.974223'::interval(0),'HH24:MI');
通过添加秒数不会将41到42舍入
答案 0 :(得分:2)
只需在间隔时间内添加30秒:
select to_char('2930:41:51.974223'::interval(0)+ '30s','HH24:MI');
to_char
---------
2930:42
(1 row)
答案 1 :(得分:0)
select to_char('2930:41:51.974223' + interval '30','HH24:MI');
或
select to_char('2930:41:51.974223' + interval '30 seconds','HH24:MI');