所有栏目

unixtodos

作者:爱百科

函数名: unixtodos

unixtodos介绍

函数名: unixtodos

功 能: 把日期和时间转换成DOS格式

程序举例

#include

#include

char *month = {"---", "Jan", "Feb", "Mar", "Apr", "May", "Jun",

"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};

#define SECONDS_PER_DAY 86400L

struct date dt;

struct time tm;

int main(void)

{

unsigned long val;

getdate(&dt);

gettime(&tm);

printf("today is %d %s %dn", dt.da_day, month, dt.da_year);

val = dostounix(&dt, &tm);

val -= (SECONDS_PER_DAY * 42);

unixtodos(val, &dt, &tm);

printf("42 days ago it was %d %s %dn",

dt.da_day, month, dt.da_year);

return 0;

}

热点导航
教育资讯 知道问答 公考资讯 司法考试 建筑知识 工作范文 大学排名 报考专业 学习方法 句子美文 秒知回答 作业解答 精选答案 知途问学