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

首頁 > 數據庫 > Oracle > 正文

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

2024-08-29 13:57:07
字體:
來源:轉載
供稿:網友
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()); 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 延川县| 通河县| 普安县| 新干县| 绥芬河市| 临汾市| 开封县| 宿州市| 金平| 随州市| 营口市| 宁德市| 溧阳市| 崇文区| 广丰县| 江油市| 苗栗县| 黄大仙区| 兰溪市| 老河口市| 上饶县| 越西县| 济南市| 元朗区| 灵川县| 垦利县| 天全县| 洪泽县| 怀宁县| 蓬莱市| 台中县| 朝阳市| 兰考县| 清流县| 太和县| 高台县| 潞西市| 梓潼县| 乌鲁木齐县| 罗田县| 额尔古纳市|