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 ...
随机推荐
- 算法篇【递归2 -- N皇后问题】
问题:输入整数N,要求在N*N的棋盘上,互相不能攻击,不在同一行同一列上,切不在对角线上,输出全部方案. 输入: 4 输出: 2 4 1 3 3 1 4 2 思路: 假设在前k-1个摆好的 ...
- Jenkins安装部署(一)
环境准备 CentOS Linux release 7.4 1.IP:192.168.43.129 2.路径:/mnt 3.jdk版本:jdk1.8.0 4.tomcat版本:tomcat-8.5 5 ...
- Redis 与Spring-data-redis 整合后封装的工具类
此工具类方法是使用了redis 与spring 整合后,才可以使用的工具类,将 spring-data-redis 一些我们开发中常用的方法进行了封装,方便我们日常开发中进行调用: package c ...
- day 14 项目目录规范; time ; logging
import sys print(sys.modules) 程序一运行,解释器将里面的所有内容全部加载到内存 项目目录规范: 代码不可能全部只写在一个文件,十几万行代码,调整,修改都很不方便. 所 ...
- 解决Eclipse添加新server时无法选择Tomcat7的问题
在Eclipse中创建了一个Web工程后,需要将该工程部署到Tomcat中进行发布.有时就会遇到在New Server对话框中选择了Tomcat 6/7后却无法单击“Next”按钮的问题,如下图所示: ...
- C#中多线程的并行处理
System.Threading.Tasks,在该命名空间下Task是主类,表示一个类的异步的并发的操作,创建并行代码的时候不一定要直接使用Task类,在某些情况下可以直接使用Parallel静态类( ...
- Vue filter-v-for 使用
var app5 = new Vue({ el: '#app5', data: { shoppingList: [ "Milk", "Donuts", &quo ...
- Java并发集合(三)-ConcurrentHashMap分析和使用
1 http://ifeve.com/hashmap-concurrenthashmap-%E7%9B%B8%E4%BF%A1%E7%9C%8B%E5%AE%8C%E8%BF%99%E7%AF%87% ...
- andorid 列表视图之SimpleAdapter
.xml <?xml version="1.0" encoding="utf-8"?> <ListView xmlns:android=&qu ...
- Linux vps服务器国产面板wdcp的安装和使用方法
对于大多数站长来说,稳定的服务器不可或缺,这是我做网站以来的深刻体会,因为之前我在网站运营方面因这个原因吃了很多亏.在这里说出,只希望朋友们不要像我一样.在网站优化过程中,服务器因素导致排名下滑,甚至 ...