静态网站提交表单怎么做,徐州手机网站制作公司哪家好,怎么做会员自动售卡网站,网站建设什么原因最主要描述
C 库函数 char *asctime(const struct tm *timeptr) 返回一个指向字符串的指针#xff0c;它代表了结构 struct timeptr 的日期和时间。
声明
下面是 asctime() 函数的声明。
char *asctime(const struct tm *timeptr)参数
timeptr 是指向 tm 结构的指针#xff0c…描述
C 库函数 char *asctime(const struct tm *timeptr) 返回一个指向字符串的指针它代表了结构 struct timeptr 的日期和时间。
声明
下面是 asctime() 函数的声明。
char *asctime(const struct tm *timeptr)参数
timeptr 是指向 tm 结构的指针包含了分解为如下各部分的日历时间
struct tm {int tm_sec; /* 秒范围从 0 到 59 */int tm_min; /* 分范围从 0 到 59 */int tm_hour; /* 小时范围从 0 到 23 */int tm_mday; /* 一月中的第几天范围从 1 到 31 */int tm_mon; /* 月份范围从 0 到 11 */int tm_year; /* 自 1900 起的年数 */int tm_wday; /* 一周中的第几天范围从 0 到 6 */int tm_yday; /* 一年中的第几天范围从 0 到 365 */int tm_isdst; /* 夏令时 */
};返回值
该函数返回一个 C 字符串包含了可读格式的日期和时间信息 Www Mmm dd hh:mm:ss yyyy其中Www 表示星期几Mmm 是以字母表示的月份dd 表示一月中的第几天hh:mm:ss 表示时间yyyy 表示年份。
实例
下面的实例演示了 asctime() 函数的用法。
#include stdio.h
#include string.h
#include time.hint main()
{struct tm t;t.tm_sec 10;t.tm_min 10;t.tm_hour 6;t.tm_mday 25;t.tm_mon 2;t.tm_year 89;t.tm_wday 6;puts(asctime(t));return(0);
}让我们编译并运行上面的程序这将产生以下结果
Sat Mar 25 06:10:10 1989