主頁(yè) > 知識(shí)庫(kù) > Oracle下時(shí)間轉(zhuǎn)換在幾種語(yǔ)言中的實(shí)現(xiàn)

Oracle下時(shí)間轉(zhuǎn)換在幾種語(yǔ)言中的實(shí)現(xiàn)

熱門標(biāo)簽:AI電銷 鐵路電話系統(tǒng) 百度競(jìng)價(jià)排名 Linux服務(wù)器 服務(wù)外包 地方門戶網(wǎng)站 網(wǎng)站排名優(yōu)化 呼叫中心市場(chǎng)需求
c shell perl php下的日期時(shí)間轉(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日凌晨零點(diǎn)以來(lái)的秒數(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()); 

標(biāo)簽:銅川 衡水 黃山 湖南 蘭州 崇左 仙桃 湘潭

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Oracle下時(shí)間轉(zhuǎn)換在幾種語(yǔ)言中的實(shí)現(xiàn)》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266