oracle unix时间戳与date转换
create or replace function unix_to_oracle(in_number number) return date is
begin
return (to_date('','yyyymmdd') + in_number/86400
+ to_number(substr(tz_offset(sessiontimezone),1,3))/24); end unix_to_oracle;
select unix_to_oracle(1509490525) from dual;

create or replace function oracle_to_unix(in_date in date) return number is
begin
return ((in_date-to_date('','yyyymmdd'))*86400 -
to_number(substr(tz_offset(sessiontimezone),1,3))*3600);
end oracle_to_unix;
select oracle_to_unix(sysdate) from dual;

oracle unix时间戳与date转换的更多相关文章
- MySql 格式化时间(包括正常时间格式与unix时间戳的互相转换)
函数:FROM_UNIXTIME 作用:将MYSQL中以INT(11)存储的时间以"YYYY-MM-DD"格式来显示.语法:FROM_UNIXTIME(unix_timestamp ...
- oracle将unix 时间戳转换为date类型
select to_date('19700101','yyyyMMdd')+numtodsinterval(8*3600,'second')+numtodsinterval(60,'second') ...
- c# datetime与 timeStamp(unix时间戳) 互相转换
/// <summary> /// Unix时间戳转为C#格式时间 /// </summary> /// <param name="timeStamp" ...
- java 时间戳与date转换
1.时间戳转换为date long sjc=1442633777; SimpleDateFormat t = new SimpleDateFormat("yyyyMMddHHmmss&quo ...
- oracle中时间戳转为Date类型的数据
问题描述: 一个表中原本应该存放date类型的数据,但是不知道之前哪位大仙把两个字段的类型建成了NUMBER类型的了,这样在后台看时间肯定不方便.现在需要改成date类型,但是现在库中是有数据的,不能 ...
- MySQL(Unix时间戳、日期)转换函数
unix_timestamp() mysql> select unix_timestamp(); +------------------+ | unix_timestamp() | +----- ...
- Oracle视图时间戳转为Date
CREATE OR REPLACE VIEW PDAORDER AS SELECT po.id id, po.order_no AS order_no, po.money AS money, (SEL ...
- oracle 根据时间戳查询date类型sql
话不多说上sql: select to_char(1574837126879/(1000*60*60*24)+to_date('1970-01-01 08:00:00','YYYY-MM-DD HH2 ...
- 将Unix时间戳转换为Date、Json属性动态生成反序列化、序列化指定属性
实体类 public class Test { [JsonIgnore] public string GetDate { get { return GetTime.ToString("yyy ...
随机推荐
- NumPy 位运算
NumPy 位运算 NumPy "bitwise_" 开头的函数是位运算函数. NumPy 位运算包括以下几个函数: 函数 描述 bitwise_and 对数组元素执行位与操作 b ...
- httpclient和httpUrlConnect区别
HttpURLConnection的用法 一.创建HttpURLConnection对象 URL url = new URL("http://localhost:8080/TestHttpU ...
- CentOS查看进程、杀死进程、启动进程等常用命令
关键字: linux 查进程.杀进程.起进程 1.查进程 ps命令查找与进程相关的PID号: ps a 显示现行终端机下的所有程序,包括其他用户的程序. ps -A 显示所有程 ...
- PTA 7-8 哈利·波特的考试(floyd)
哈利·波特要考试了,他需要你的帮助.这门课学的是用魔咒将一种动物变成另一种动物的本事.例如将猫变成老鼠的魔咒是haha,将老鼠变成鱼的魔咒是hehe等等.反方向变化的魔咒就是简单地将原来的魔咒倒过来念 ...
- f5创建VS
1.1) 2) 3) 4) 5) 2.Availability 1)Pool 中的monitor保障服务高可用 2)Pool 失败机制一 Fallback Host 最后的host( 使用于HTTP ...
- idea工程中web.xml报错Servlet should have a mapping
搭建ssm工程过程中web.xml报错:Servlet should have a mapping ....但是mapping已经配置好了...如下图: 搜索无果,后来发现是工程的web.xml位置配 ...
- 举个通俗易懂的例子告诉你IAAS,SAAS,PAAS的区别
作者:何足道链接:https://www.zhihu.com/question/21641778/answer/62523535来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明 ...
- stark组件开发之URL分发和默认Handler
为register 函数添加一个,prev参数,默认None ,用于可以让用户自己指定前缀. def register(self, model_class, handler_class=None, p ...
- 操作系统的发展史 day36
什么是操作系统 可能很多人都会说,我们平时装的windows7 windows10都是操作系统,没错,他们都是操作系统.还有没有其他的? 想想我们使用的手机,Google公司的Androi ...
- BOM心得
Brower Objects Model浏览器对象模型 ps: 到现在也没个正式标准.............. window是BOM的顶级对象,但一般可以省略 一.Location对象 相当于浏览器 ...