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


猜你喜欢
- 1 前言前面文章Python爬虫获取基金列表、Python爬虫获取基金基本信息我们已经介绍了怎么获取基金列表以及怎么获取基金基本信息,本文我
- 如下所示:#coding utf-8a=0.001 #定义收敛步长xd=1 #定义寻找步
- SQL Server UPDATE语句用于更新数据,下面就为您详细介绍SQL Server UPDATE语句语法方面的知识,希望可以让您对S
- Pytest和Unittest测试框架的区别?如何区分这两者,很简单unittest作为官方的测试框架,在测试方面更加基础,并且可以再次基础
- 前言本文总结了mysql中DCL,常用的一些权限控制,后续使用到其他会继续补充。一、用户控制管理创建用户create user '用
- 本文实例为大家分享了windows下mysql 8.0.12安装步骤及使用教程,供大家参考,具体内容如下1.到官网下载下载SQL。(1.1)
- 描述微软开发的两个动态库存在后门允许用户查看ASP文件源程序和下载整个网站详细随IIS和Frontpage Extention server
- 上一篇实战爬取知乎热门话题的实战,并且保存为本地的txt文本先上代码,有很多细节和坑需要规避,弄了两个半小时import requestsi
- sql中经常用like进行模糊查询,而模糊查询就要用到百分号“%”,下划线“_”这些通配符,其中“%”匹配任意多个字符,“_”匹配单个字符。
- 正则表达式的定义在编写处理字符串的程时,经常会遇到在一段文本中查找符合某些规则的字符串的需求,正则表达式就是用于描述这些规则的工具,换句话说
- 注意,在改变数值之前锁定应用,确保一段时间里只有一个客户执行该语句。<SCRIPT LANGUAGE="VBScr
- pip用pipdeptree查看包依赖1、安装pipdeptreepip install pipdeptree2、使用pipdeptree查
- 今天想用ruby on rails做一个小项目,需要用到mysql数据库,项目中的数据已经有了,只不过是保存在Sql Server中,用ra
- 一种类似Flask开发的WebSocket-Server服务端框架,适用python3.X1、安装模块Pywsspip install py
- golang常用库:gorilla/mux-http路由库使用golang常用库:配置文件解析库-viper使用golang常用库:操作数据
- 下面是代码class GroupInfos(models.Model): uid = models.AutoField(primary_ke
- Python判断变量是否已经定义是一个非常重要的功能,本文就来简述这一功能的实现方法。其实Python中有很多方法可以实现判断一个变量是否已
- 爬楼梯(Climbing-Stairs)题干:假设你正在爬楼梯。需要 n 阶你才能到达楼顶。每次你可以爬 1 或 2 个台阶。你有多少种不同
- 环境win10, python3.7,pyinstaller3.6一 下载pyinstaller(1)cmd中pip install pyi
- python的数据类型有:数字(int)、浮点(float)、字符串(str),列表(list)、元组(tuple)、字典(dict)、集合