Oracle下时间转换在几种语言中的实现_Oracle教程-查字典教程网
Oracle下时间转换在几种语言中的实现
Oracle下时间转换在几种语言中的实现
发布时间:2016-12-28 来源:查字典编辑
摘要:cshellperlphp下的日期时间转换:秒数与人类可读日期scalarlocaltime与secondssince`00:00:0019...

cshellperlphp下的日期时间转换:秒数与人类可读日期scalarlocaltime与secondssince`00:00:001970-01-01UTC'

scalarlocaltime26-bytestring与secondssince`00:00:001970-01-01UTC'

(1970年1月1日凌晨零点以来的秒数)

thenumberofsecondsthathavepassedsincetheEpoch:00:00:00January1,1970,CoordinatedUniversalTime(UTC).

c:

《AdvancedProgrammingintheUNIXEnvironment:SecondEdition》

简称《APUE》Seciont6.10Figure6.8.Relationshipofthevarioustimefunctions说的清楚

#include<time.h>

time_ttime(time_t*calptr);

structtm*localtime(consttime_t*calptr);

structtm*gmtime(consttime_t*calptr);

time_tmktime(structtm*tmptr);

char*asctime(conststructtm*tmptr);

char*ctime(consttime_t*calptr);

size_tstrftime(char*restrictbuf,size_tmaxsize,

constchar*restrictformat,

conststructtm*restricttmptr);

shell:

%date+%s

1128621784

%date-d"1970-01-01UTC1128621784seconds"

FriOct702:03:04CST2005

date-d"1970-01-01UTC1128621784seconds"+"%Y-%m-%d%H:%M:%S"

2005-10-0702:03:04

perl:

%perl-e'printscalarlocaltime1128621784'

FriOct702:03:042005

php:

date('Y-m-dH:i:s',time());

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新Oracle教程学习
    热门Oracle教程学习
    编程开发子分类