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

来源:asp之家 时间:2009-02-28 11:09:00 

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());

标签:Oracle,时间,转换,语言
0
投稿

猜你喜欢

  • jQuery性能优化指南[译]

    2009-05-12 11:54:00
  • 较完善的日历组件js源码(兼容)

    2010-08-08 08:43:00
  • AXObject解决IE需要激活 ActiveX 控件方法

    2007-11-08 12:16:00
  • 网页设计中怎么将px换成em

    2008-04-16 13:50:00
  • 如何解决MySQL的客户端不支持鉴定协议

    2008-11-27 17:10:00
  • 利用XMLHTTP检测网址及探测服务器类型

    2009-04-24 15:12:00
  • RHEL下架设MYSQL集群

    2008-12-24 16:05:00
  • Dreamweaver量身打造Wordpress留言板(二)

    2009-12-12 17:35:00
  • 该死的IE,走好

    2009-01-15 12:26:00
  • CSS实现HTML元素透明的那些事

    2010-02-01 12:34:00
  • opera img onload重复执行

    2008-01-17 12:01:00
  • ASP也使用ORM,给ASP上所有的SQL注入画上句号

    2011-04-03 11:02:00
  • asp如何在读取Excel文件时创建列表的下拉菜单?

    2010-06-18 19:59:00
  • CSS Hack 汇总快查

    2007-11-06 11:48:00
  • ASP中类的详细介绍(class Property Get、Property Let)

    2008-02-20 19:18:00
  • asp使用正则自动解析图片地址并保存

    2007-08-17 11:29:00
  • 如何提升JavaScript的运行速度(DOM篇)

    2010-05-17 13:32:00
  • mysql5在rhel5下乱码问题及解决方法

    2010-12-03 16:26:00
  • 垂直栅格与渐进式行距(上)

    2009-04-01 18:30:00
  • Javascript操作表单之间的数据传递

    2007-10-25 12:58:00
  • asp之家 网络编程 m.aspxhome.com