函数中包含的返回日期,小时,分钟和秒 [英] Return date, hours,minutes and seconds included from function

查看:147
本文介绍了函数中包含的返回日期,小时,分钟和秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的功能如下所示,但不起作用.我真的不知道是什么.也试图返回"sysdate",将不胜感激.

My functions looks as below, but it does not work. I can't really figure out what. Tried to return "sysdate" as well, help would be much appreciated.

我希望它显示小时,分钟和秒,而不仅仅是日期!

I want it to display hours, minutes and seconds, not just a date!

create or replace function get_date
return date
is 
begin
return sysdate('YYYY-MM-DD: HH24:MI:SS') + 7;
end;
/

推荐答案

尝试一下(您必须将返回类型更改为varchar2)

Try this (you'll have to change your return type to a varchar2)

return to_char(sysdate + 7, 'YYYY-MM-DD HH24:MI:SS')

这篇关于函数中包含的返回日期,小时,分钟和秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆