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 包含大量的各种数学运算的函数,包括三角函数,算术运算的函数,复数处理函数等. 三角函数 NumPy 提供了标准的三角函数:sin().cos().tan(). 实例 ...
- pandas中series和dataframe之间的区别
series结构有索引,和列名组成,如果没有,那么程序会自动赋名为None series的索引名具有唯一性,索引可以数字和字符,系统会自动将他们转化为一个类型object. dataframe由索引和 ...
- js阻止时间冒泡事件——event.stopPropagation()
1. 作用:不再派发事件. 2. 语法: html代码: <div class="oreder-cont" ng-click="Orderdetails()&quo ...
- 项目总结15:JavaScript模拟表单提交(实现window.location.href-POST提交数据效果)
JavaScript模拟表单提交(实现window.location.href-POST提交数据效果) 前沿 1-在具体项目开发中,用window.location.href方法下载文件,因windo ...
- 安装sql server 2008 提示错误 SQL Server 2005 Express 工具。 失败
安装sql server 2008 management,提示错误:Sql2005SsmsExpressFacet 检查是否安装了 SQL Server 2005 Express 工具. 失败,已安装 ...
- day 24 socket 黏包
socket 套接字的使用: tcp是基于链接的,必须先启动服务端,然后再启动客户端去链接服务端 server 端 import socket sk = socket.socket() # 实例化一个 ...
- asp相关知识整理
WWW----World Wide Web(万维网) URL----Uniform Resource Locator(统一资源定位符) HTTP----Hyper Text Transfer Prot ...
- 编程:在屏幕中间分别显示绿色、绿底红色、白底蓝色的字符串'welcome to masm!'
80*25彩色字符模式显示缓冲区的结构: 内存地址空间中,B8000H~BFFFFH共32KB的空间,为80*25彩色字符模式的显示缓冲区.向这个地址空间写入数据,写入的内容将立即出现在显示器上. 在 ...
- A Spectral Technique for Correspondence Problems Using Pairwise Constraints
Abstract 我们提出了一种有效的谱方法来寻找两组特征之间的一致对应关系.我们建立了一个图的邻接矩阵M,它的节点代表了潜在的对应,而链接上的权重代表潜在的对应之间的成对协议.正确的分配可在彼此之间 ...
- oracle 11g用exp无法导出空表的解决方案
racle 11g中有个新特性,当表无数据时,不分配segment,以节省空间,当我们用exp导出空表时,无法导出. 解决方法是两个方面, 一是处理现有的空表,让其能导出: 二是设置参数,让后续的新的 ...