Oracle下時(shí)間轉(zhuǎn)換在幾種語言中的實(shí)現(xiàn)
scalar localtime 26-byte string 與 seconds since `00:00:00 1970-01-01 UTC'
(1970年1月1日凌晨零點(diǎn)以來的秒數(shù))
the number of seconds that have passed since the Epoch: 00:00:00 January 1, 1970, Coordinated Universal Time (UTC).
c:
《Advanced Programming in the UNIX Environment: Second Edition》
簡(jiǎn)稱《APUE》 Seciont 6.10 Figure 6.8. Relationship of the various time functions 說的清楚
#include <time.h>
time_t time(time_t *calptr);
struct tm *localtime(const time_t *calptr);
struct tm *gmtime(const time_t *calptr);
time_t mktime(struct tm *tmptr);
char *asctime(const struct tm *tmptr);
char *ctime(const time_t *calptr);
size_t strftime(char *restrict buf, size_t maxsize,
const char *restrict format,
const struct tm *restrict tmptr);
shell:
% date +%s
1128621784
% date -d "1970-01-01 UTC 1128621784 seconds"
Fri Oct 7 02:03:04 CST 2005
date -d "1970-01-01 UTC 1128621784 seconds" +"%Y-%m-%d %H:%M:%S"
2005-10-07 02:03:04
perl:
% perl -e 'print scalar localtime 1128621784'
Fri Oct 7 02:03:04 2005
php:
date('Y-m-d H:i:s',time());
相關(guān)文章
Oracle下時(shí)間轉(zhuǎn)換在幾種語言中的實(shí)現(xiàn)
Oracle下時(shí)間轉(zhuǎn)換在幾種語言中的實(shí)現(xiàn)...2007-04-04ORACLE LATERAL-SQL-INJECTION 個(gè)人見解
最近忙啊忙啊的,今天終于有點(diǎn)點(diǎn)時(shí)間抽出來看看技術(shù)文章了,最近國(guó)外又出了關(guān)于新型ORA注入技術(shù)的PAPER,趕緊測(cè)試,主要是出現(xiàn)在SQL語句字符拼 接的時(shí)候,DATE類型轉(zhuǎn)換為VARCHAR 以及 NUMBER轉(zhuǎn)換為VARCHAR加入的格式字符出現(xiàn)問題。2008-05-05Oracle 函數(shù)大全[字符串函數(shù),數(shù)學(xué)函數(shù),日期函數(shù)]
字符串函數(shù),數(shù)學(xué)函數(shù),日期函數(shù),邏輯運(yùn)算函數(shù),其他函數(shù)2008-09-09java.sql.SQLException: 內(nèi)部錯(cuò)誤: Unable to construct a Datum fro
Unable to construct a Datum from the specified input的解決方法2008-09-09Oracle 自增(auto increment) 或 標(biāo)識(shí)字段的建立方法
SQL SERVER 和 ACCESS 以及 MYSQL 中, 都有一種 自增字段, 通常被用來做 主鍵 或 索引鍵, 但是 ORACLE 中,確并沒有提供這種字段類型(實(shí)際并不是一種字段類型) ,但我們確經(jīng)常需要這個(gè)功能。2008-11-11在Oracle PL/SQL中游標(biāo)聲明中表名動(dòng)態(tài)變化的方法
在Oracle PL/SQL中游標(biāo)聲明中表名動(dòng)態(tài)變化的方法...2007-04-04Oracle存儲(chǔ)過程入門學(xué)習(xí)基本語法
Oracle存儲(chǔ)過程基本語法學(xué)習(xí)入門必備2008-09-09