国产探花免费观看_亚洲丰满少妇自慰呻吟_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()); 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 文化| 天水市| 会东县| 永仁县| 密云县| 普洱| 独山县| 右玉县| 阿坝县| 民丰县| 甘洛县| 伊通| 桦川县| 贵州省| 呼和浩特市| 海伦市| 扎兰屯市| 忻城县| 美姑县| 喀喇沁旗| 中方县| 阳山县| 潍坊市| 泰兴市| 新巴尔虎右旗| 靖远县| 民权县| 霍林郭勒市| 伊金霍洛旗| 万盛区| 达拉特旗| 贵州省| 临清市| 防城港市| 洛扎县| 贺兰县| 都江堰市| 肥乡县| 惠来县| 宕昌县| 嘉定区|