国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > Oracle > 正文

Oracle下時間轉換在幾種語言中的實現

2020-07-26 14:36:18
字體:
來源:轉載
供稿:網友
c shell perl php下的日期時間轉換: 秒數與人類可讀日期 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日凌晨零點以來的秒數)
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()); 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 新昌县| 工布江达县| 牟定县| 如东县| 桃江县| 商水县| 浦江县| 松阳县| 德钦县| 三河市| 镇江市| 桐城市| 巴里| 铁力市| 杭锦后旗| 衡阳县| 辽源市| 西和县| 射洪县| 五常市| 白银市| 罗田县| 长治市| 漳州市| 小金县| 永昌县| 都兰县| 大厂| 昌都县| 岳阳市| 余干县| 莱州市| 麻阳| 吉安县| 五寨县| 丰顺县| 沁水县| 南陵县| 手游| 弥渡县| 冷水江市|