ChinaUnix.net
相关文章推荐:

linux 日期

各位大侠,如何生成2010-05-02 到2010-08-03? 2010-05-02 2010-05-03 2010-05-04 。。 。。 。。 2010-08-03 谢谢!

by top50 - Shell - 2011-10-18 11:20:59 阅读(5031) 回复(10)

相关讨论

1) 找到相应的时区文件 /usr/share/zoneinfo/Asia/Shanghai,用这个文件替换当前的/etc/localtime文件。 2) 修改/etc/sysconfig/clock文件,修改为: ZONE="Asia/Shanghai" UTC=false ARC=false 3) 时间设定成2005年8月30日的命令:#date -s 06/28/2007 将系统时间设定成下午6点40分0秒的命令:#date -s 12:15:00 4) 同步BIOS时钟,强制把系统时间写入CMOS,命令:#clock -w 本文来自ChinaUnix博客,如果查看原文请点:http...

by lukeunique - Linux文档专区 - 2009-03-26 12:41:07 阅读(879) 回复(0)

date # date -s "2008-7-19 cst" # date -s 18:10 # rdate time-a.nist.gov 查看 rdate: [time-a.nist.gov] Mon Jul 21 18:09:17 2008 # rdate -s time-a.nist.gov ntpdate (RHEL5没有) 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/47052/showart_1145946.html

by 宗禹 - Linux文档专区 - 2008-08-24 19:53:41 阅读(916) 回复(0)

date -s 10/10/2009 //设置日期为2009-10-10 date -s 13:55:00 //设置时间为下午1点55分 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/94651/showart_2067193.html

by mywiki - Linux文档专区 - 2009-10-10 16:00:10 阅读(1180) 回复(0)

[color="#ff0000"]一、文本模式下修改 命令及参数选项: [color="#ff0000"] date -s 示例如下:   #[color="#ff0000"]date -s 04/11/2008 ------将系统时间设定成2008年4月11日      #[color="#ff0000"]date -s 22:14:30 ------将系统时间设定成22点14分30秒 #[color="#ff0000"]clock -w ------确保修改生效 [color="#ff0000"]二、图...

by sjhf - Linux文档专区 - 2009-03-23 11:23:33 阅读(733) 回复(0)

运行date的结果: 现在的格式为:【五 3月 13 23:26:24 CST 2009】 需要改成的格式为:【2009年 03月 13日 星期五 23:26:35 CST】 请不要使用“alias date=....."的方式。 系统是centos 4.7 谢谢啊!

by iix - Shell - 2009-03-15 00:26:11 阅读(11473) 回复(7)

RHCE西安首场考试定于2008.10.07举办,考试地点:西安高新区高新路31号凯创国际2幢1302室 咨询qq:312864402 咨询热线:029—88248109 网址:www.xalinux.org 西安升旭是西北地区首家提供红帽官方授权认证的RHCE培训考试中心,我们提供RHCE官方正版教材,也是一个提供linux技术支持的服务中心。

by wangle312864402 - 培训交流 - 2008-09-25 16:11:35 阅读(1285) 回复(0)

asctime(将时间和日期以字符串格式表示) 相关函数 time,ctime,gmtime,localtime 表头文件 #include 定义函数 char * asctime(const struct tm * timeptr); 函数说明 asctime()将参数timeptr所指的tm结构中的信息转换成真实世界所使用的时间日期表示方法,然后将结果以字符串形态返回。此函数已经由时区转换成当地时间,字符串格式为:“Wed Jun 30 21:49:08 1993n” 返回值 若再调用相关的时间日期函数,此字符串可能...

by zixin - Linux文档专区 - 2007-09-22 16:08:06 阅读(644) 回复(0)

$(date +%Y-%m-%d-%H:%M).log 生成格式如下:2008-12-18-16:43.log   时间方面 :   % : 印出 %   %n : 下一行   %t : 跳格   %H : 小时(00..23)   %I : 小时(01..12)   %k : 小时(0..23)   %l : 小时(1..12)   %M : 分钟(00..59)   %p : 显示本地 AM 或 PM   %r : 直接显示时间 (12 小时制,格式为 hh:mm:ss [AP]M)   %s : 从 1970 年 1 月 1 日 00:00:00 UTC 到目前为止的秒数   %S : 秒...

by marinercn - Linux文档专区 - 2009-12-04 22:04:27 阅读(1330) 回复(0)

我们一般使用“date -s”命令来修改系统时间。比如将系统时间设定成1996年6月10日的命令如下。 #date -s 06/10/96 将系统时间设定成下午1点12分0秒的命令如下。 #date -s 13:12:00 ---- 注意,这里说的是系统时间,是linux由操作系统维护的。 ---- 在系统启动时,linux操作系统将时间从CMOS中读到系统时间变量中,以后修改时间通过修改系统时间实现。为了保持系统时间与CMOS时间的一致性, linux每隔一段时间会将系统时间写...

by sjhf - Linux文档专区 - 2009-03-23 11:29:34 阅读(579) 回复(0)

1、日历时间 (time_t) #include time.h> time_t time(time_t *calptr); struct tm *gmtime(const time_t *calptr); struct tm *localtime(const time_t *calptr); char *asctime(const struct tm *tmptr); char *ctime(const time_t *calptr); struct tm;参考apue.2e书143 和time_t有关还有其他一些函数,用的时候再说 我的一些测试代码: #include time.h> 2 #include stdio.h> 3 int 4 main(void) 5...

by eelb123 - Linux文档专区 - 2008-11-20 20:21:15 阅读(754) 回复(0)