Linux中时间戳转换命令
原文地址:http://wanping.blogbus.com/logs/28663569.html
1、时间戳转换为正常显示的时间格式
Freebsd
系统下:
转换命令为:
date -r 1112173761 或者:date -r 1112173761 +"%Y-%m-%d %T %z"(年月日的格式不一样)
Linux
系统下:
转换命令:date -d '1970-01-01 UTC 1112173761 seconds'" 或者 date -d '1970-01-01 UTC 1112173761 seconds' +"%Y-%m-%d %T %z" (年月日格式不一样)
时间戳转换为正常显示的时间格式,问题解决了,那么如何把我们正常的时间格式转为时间戳呢
2、正常显示的时间格式转换为时间戳
php把当前时间转换为时间戳
php -r "echo(mktime());"
这里需要说下,使用
php
的时候,如果不想每次都在文件中编写执行,就是用
php -r
命令,就把后面的脚本执行了。
php把未来某天的时间转为时间戳
php -r "echo(strtotime('+2 days'));"
//
把后天的时间转为时间戳
我测试的系统需要把过期时间比较久,那么至少要在我测试完系统才要他过期,不需要每次时间到了又要更换过期时间,我就把过期时间设为
100
天,执行命令如下:
php -r "echo(strtotime('+100 days'));"
Linux、FreeBsd系统当前时间转换为时间戳:
date +%s
相关文档:
【1. linux applications 有两种形式】
i)可执行的文件: 可由计算机直接运行,相当于windows的.exe文件
ii)Script: collections of instructions for another program. 相当于windows的.bat .cmd文件
【2. PATH】
在Linux中,当输入程序名(如Firefox)时,系统会在名为PATH的Shell变量所给 ......
网上有篇帖子包含里linux下的dnw,我在用idea6410,编译dnw和secbulk后并不能正常使用
LINUX下的DNW程序下载
http://linux.chinaunix.net/bbs/viewthread.php?tid=1055992
secbulk设备未建立,手动建立/dev/secbulk0并不起作用,原因是secbulk probe会匹配id_table,这个是为QQ2440准备的,所以需要改id_table
static s ......
Get Redhat Enterprise 3.0 from:
Your local RedHat rep�
Get Veritas’ VCS and VM products from:
ftp://ftp.veritas.com/pub/products/fst_ha.lxrt2.2.redhatlinux.tar.gz
ftp://ftp.veritas.com/pub/products/fst_ha.lxrt2.2MP1.redhatlinux.tar.gz
You will need a temporary key to complete this ......
linux 下 用c语言创建mysql数据库笔记(一)
-----仅为个人学习摘要,并不断更新中。。。。
在引用头文件时必须包含‘mysql.h’的头文件(必须是mysql.h的绝对地址,一般在mysql下的include目录下,仔细看看你的在哪里?*),
我是ubuntu9。04,在/usr/include/mysql/mysql ......
一、登陆
1.进入linux
2.用户名: root
3.口令:123456
4.mysql 用户名 root 密码 123456
二、启动mysql与apache服务
1.启动mysq数据库:/usr/local/mysql/bin/./mysqld_safe --user=mysql &
2.停止mysql数据库:/usr/local/mysql/bin/mysqladmin -u root -p shutdown
3.启动apache: /usr/local/apache2/bin/./ap ......