什么是unixtodos

核心提示函数名: unixtodos功 能: 把日期和时间转换成DOS格式中文名unixtodos功 能:把日期和时间转换成DOS格式程序例:#include用 法void unixtodos(long utime, struct date *da

最佳答案:

函数名: unixtodos

详情介绍

函数名: unixtodos

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

中文名
unixtodos
功 能:
把日期和时间转换成DOS格式
程序例:
#include
用 法
void unixtodos(long utime, struct date *dateptr,struct time *timeptr)

程序举例

#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;

}

 
友情链接
鄂ICP备19019357号-22