#include #include #include #include #define TRUE 0 #define FALSE -1 typedef struct { int BYTESPRO; int BYTESAVL; char MSGID[7]; char RESRVD; char EXCPDATA[100]; } ERRSTRUCTURE; /* Define the error return structure */ ERRSTRUCTURE errcode;/* Error Code Structure for RCVMSG */ void main(void){ Qus_OBJD0100_t objd0100; char date_time[14], year[4], DATE[11], TIME[9]; typedef struct { char year[5]; char month[3]; char day[3]; } DATE_; DATE_ date; typedef struct { char hour[3]; char minute[3]; char second[3]; } TIME_; TIME_ time; printf("** TESTLIBDAT: 最終更新日付の検索 **\n"); getchar(); errcode.BYTESPRO = 160; errcode.BYTESAVL = 0; QUSROBJD(&objd0100, sizeof(Qus_OBJD0100_t),"OBJD0100", "SPOOLWTR *LIBL ", "*LIB ", &errcode); memcpy(date_time, objd0100.Change_Date_Time, 13); date_time[13] = 0x00; printf("SPOOLWTR(*LIB) date_time = [%s]\n", date_time); memcpy(year, "20", 2); memcpy(&year[2], &date_time[1], 2); memcpy(date.year, year, 4); date.year[4] = 0x00; memcpy(date.month, &date_time[3], 2); date.month[2] = 0x00; memcpy(date.day, &date_time[5], 2); date.day[2] = 0x00; sprintf(DATE, "%s/%s/%s", date.year, date.month, date.day); printf("DATE = [%s]\n", DATE); memcpy(time.hour, &date_time[7], 2); time.hour[2] = 0x00; memcpy(time.minute, &date_time[9], 2); time.minute[2] = 0x00; memcpy(time.second, &date_time[11], 2); time.second[2] = 0x00; sprintf(TIME, "%s:%s:%s", time.hour, time.minute, time.second); printf("time = [%s]\n", TIME); getchar(); }