易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux时间函数


asctime(将时间和日期以字符串格式表示)
相关函数
time,ctime,gmtime,localtime

表头文件
#include<time.h>

定义函数
char * asctime(const struct tm * timeptr);

函数说明
asctime()将参数timeptr所指的tm结构中的信息转换成真实世界所使用的时间日期表示方法,然后将结果以字符串形态返回。此函数已经由时区转换成当地时间,字符串格式为:“Wed Jun 30 21:49:08 1993\n”

返回值
若再调用相关的时间日期函数,此字符串可能会被破坏。此函数与ctime不同处在于传入的参数是不同的结构。

附加说明
返回一字符串表示目前当地的时间日期。

范例
#include <time.h>
main()
{
time_t timep;
time (&timep);
printf(“%s”,asctime(gmtime(&timep)));
}

执行
Sat Oct 28 02:10:06 2000



ctime(将时间和日期以字符串格式表示)
相关函数
time,asctime,gmtime,localtime

表头文件
#include<time.h>

定义函数
char *ctime(const time_t *timep);

函数说明
ctime()
将参数timep所指的time_t结构中的信息转换成真实世界所使用的时间日期表示方法,然后将结果以字符串形态返回。此函数已经由时区转换成当地时
间,字符串格式为“Wed Jun 30 21 :49 :08 1993\n”。若再调用相关的时间日期函数,此字符串可能会被破坏。

返回值
返回一字符串表示目前当地的时间日期。

范例
#include<time.h>
main()
{
time_t timep;
time (&timep);
printf(“%s”,ctime(&timep));
}

执行
Sat Oct 28 10 : 12 : 05 2000



gettimeofday(取得目前的时间)
相关函数
time,ctime,ftime,settimeofday

表头文件
#include <sys/time.h>
#include <unistd.h>

定义函数
int gettimeofday (


相关文档:

实战Linux Bluetooth编程(三) HCI层编程

1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI)  就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......

linux设置网关修改ip相关

修改ip地址
即时生效:
# ifconfig eth0 192.168.0.20 netmask 255.255.255.0
启动生效:
修改/etc/sysconfig/network-scripts/ifcfg-eth0
修改default gateway
即时生效:
# route add default gw 192.168.0.254
启动生效:
修改/etc/sysconfig/network-scripts/ifcfg-eth0
修改dns
修改/etc/resolv.conf
修改后可 ......

LINUX文件系统中的stat结构

stat结构的成员在不同的unix中会有所变化.. 但一般都包含以下所示的内容:
St_mode  文件权限和文件类型信息。
st_ino      与该文件关联的inode
st_dev       保存文件的设备
st_uid     文件属主的UID号
st_gid    ......

Linux环境变量设置

本文转载于:  http://hi.baidu.com/peruke/blog/item/7f1f34580a0eb6d89c82043b.html
Linux是一个多用户的操作系统。每个用户登录系统后,都会有一个专用的运行环境。通常每个用户默认的环境都是相同的,这个默认环境实际上就是一组环境变量的定义。用户可以对自己的运行环境进行定制,其方法就是修改相应的系统环境 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号