Oracle下時間轉(zhuǎn)換在幾種語言中的實現(xiàn)
更新時間:2007年04月02日 00:00:00 作者:
c shell perl php下的日期時間轉(zhuǎn)換: 秒數(shù)與人類可讀日期 scalar localtime 與 seconds since `00:00:00 1970-01-01 UTC'
scalar localtime 26-byte string 與 seconds since `00:00:00 1970-01-01 UTC'
(1970年1月1日凌晨零點以來的秒數(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》
簡稱《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());
scalar localtime 26-byte string 與 seconds since `00:00:00 1970-01-01 UTC'
(1970年1月1日凌晨零點以來的秒數(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》
簡稱《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下時間轉(zhuǎn)換在幾種語言中的實現(xiàn)
Oracle下時間轉(zhuǎn)換在幾種語言中的實現(xiàn)...2007-04-04ORACLE LATERAL-SQL-INJECTION 個人見解
最近忙啊忙啊的,今天終于有點點時間抽出來看看技術(shù)文章了,最近國外又出了關(guān)于新型ORA注入技術(shù)的PAPER,趕緊測試,主要是出現(xiàn)在SQL語句字符拼 接的時候,DATE類型轉(zhuǎn)換為VARCHAR 以及 NUMBER轉(zhuǎn)換為VARCHAR加入的格式字符出現(xiàn)問題。2008-05-05Oracle 函數(shù)大全[字符串函數(shù),數(shù)學(xué)函數(shù),日期函數(shù)]
字符串函數(shù),數(shù)學(xué)函數(shù),日期函數(shù),邏輯運算函數(shù),其他函數(shù)2008-09-09java.sql.SQLException: 內(nèi)部錯誤: Unable to construct a Datum fro
Unable to construct a Datum from the specified input的解決方法2008-09-09Oracle 自增(auto increment) 或 標識字段的建立方法
SQL SERVER 和 ACCESS 以及 MYSQL 中, 都有一種 自增字段, 通常被用來做 主鍵 或 索引鍵, 但是 ORACLE 中,確并沒有提供這種字段類型(實際并不是一種字段類型) ,但我們確經(jīng)常需要這個功能。2008-11-11在Oracle PL/SQL中游標聲明中表名動態(tài)變化的方法
在Oracle PL/SQL中游標聲明中表名動態(tài)變化的方法...2007-04-04