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

前端之家收集整理的这篇文章主要介绍了Oracle下时间转换在几种语言中的实现前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

cshellperlPHP下的日期时间转换:秒数与人类可读日期scalarlocaltime与secondssince00:00:001970-01-01UTC' <BR>scalarlocaltime26-bytestring与secondssince00: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_tcalptr);
structtm
localtime(consttime_tcalptr);
structtm
gmtime(consttime_tcalptr);
time_tmktime(structtm
tmptr);
charasctime(conststructtmtmptr);
charctime(consttime_tcalptr);
size_tstrftime(charrestrictbuf,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相关文章