欢迎您光临深圳塔灯网络科技有限公司!
电话图标 余先生:13699882642

网站百科

为您解码网站建设的点点滴滴

首页  >   > 技术知识

Oracle下时间转换在几种语言中的实现

发表日期:2019-11 文章编辑:小灯 浏览次数:811

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()); 
本页内容由塔灯网络科技有限公司通过网络收集编辑所得,所有资料仅供用户参考了本站不拥有所有权,如您认为本网页中由涉嫌抄袭的内容,请及时与我们联系,并提供相关证据,工作人员会在5工作日内联系您,一经查实,本站立刻删除侵权内容。本文链接:http://www.dengtar.com/26215.html
相关
 八年  行业经验

多一份参考,总有益处

联系深圳网站公司塔灯网络,免费获得网站建设方案及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:余经理:13699882642

Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.