<?php //查找字符串函数 // strpos() 查找字符第一次出现的位置 重点区分大小写 //stripos — 查找字符串首次出现的位置(不区分大小写) //strrpos — 计算指定字符串在目标字符串中最后一次出现的位置 $str = "hello world"; $position = strpos($str, 'e'); // $position = stripos($str, 'E'); // $position = strrpos($str, 'l'); e…
1.to_date:日期时间转日期函数 select to_date('2015-04-02 13:34:12');输出:2015-04-02122.from_unixtime:转化unix时间戳到当前时区的时间格式 select from_unixtime(1323308943,’yyyyMMdd’);输出:20111208123.unix_timestamp:获取当前unix时间戳 select unix_timestamp();输出:1430816254select unix_timest…
--Oracle trunc()函数的用法/**************日期********************/1.select trunc(sysdate) from dual --2013-01-06 今天的日期为2013-01-062.select trunc(sysdate, 'mm') from dual --2013-01-01 返回当月第一天.3.select trunc(sysdate,'yy') from dual --2013-01-01 返回当年第一天4.select…
CURDATE()或CURRENT_DATE() 返回当前的日期 CURTIME()或CURRENT_TIME() 返回当前的时间 DATE_ADD(date,INTERVAL int keyword)返回日期date加上间隔时间int的结果(int必须按照关键字进行格式化),如:SELECTDATE_ADD(CURRENT_DATE,INTERVAL 6 MONTH); DATE_FORMAT(date,fmt)  依照指定的fmt格式格式化日期date值 DATE_SUB(date,INTE…
CURDATE()或CURRENT_DATE() 返回当前的日期 CURTIME()或CURRENT_TIME() 返回当前的时间 DATE_ADD(date,INTERVAL int keyword)返回日期date加上间隔时间int的结果(int必须按照关键字进行格式化),如:SELECTDATE_ADD(CURRENT_DATE,INTERVAL 6 MONTH); DATE_FORMAT(date,fmt)  依照指定的fmt格式格式化日期date值 DATE_SUB(date,INTE…
SYSDATE 函数:是一个日期函数,它返回当前数据库服务器的日期和时间. 用日期计算: • 从日期加或者减一个数,结果是一个日期值 • 两个日期相减,得到两个日期之间的天数 ,可以加小时到日期上 SQL> select sysdate from dual; SYSDATE ----------- 2019/7/30 1 SQL> select sysdate+1 from dual; SYSDATE+1 ----------- 2019/7/31 1 SQL> select sysda…
一.字符串的常用函数. --一.oracle 字符串常用函数 --1. concat 连接字符串的函数,只能连接[两个]字符串. 字符写在括号中,并用逗号隔开! --2."||"符号可以连接多个字符串 直接用||将多个字符链接即可. --3. dual? dual是一个虚拟表,用来构成select的语法规则,oracle保证dual里面永远只有一条记录. select concat('lo','ve')from dual; select concat('o','k')from dual…
获取当前UNIX时间戳函数: unix_timestamp语法: unix_timestamp() 返回值: bigint说明: 获得当前时区的UNIX时间戳举例: hive> select unix_timestamp() from dual; OK Time taken: row(s) 日期函数UNIX时间戳转日期函数: from_unixtime 语法:from_unixtime(bigint unixtime[, string format]) 返回值: string说明: 转化UNIX…
1. from_unixtime 日期函数UNIX时间戳转日期函数: from_unixtime 语法:from_unixtime(bigint unixtime[, stringformat]) 返回值: string说明: 转化UNIX时间戳(从1970-01-0100:00:00 UTC到指定时间的秒数)到当前时区的时间格式举例: ); +----------------------+--+ | _c0 | +----------------------+--+ :: | +-------…