And the missing function, as the post would have gone over 5000 chars:
char * asctimeDMYT ( struct tm *tmPtr )
{
/*-------------------------------------------------------------------------------------
This function is passed a pointer to a tm structure, containing date and
time of day information. Structures of type tm are known to CVI, and do not
need to be declared. The function extracts data from the structure to return a
pointer to a null-terminated character string, to display the time of day in
the form DOW DD MMM YYYY HH:MM:SS, where:
DOW -- Day of week, three character abbreviation
DD -- Day of month number
MMM -- Month name, three character abbreviation
YYYY -- Year number, four characters
HH -- Hour number, 00 to 23
MM -- Minute number, 00 to 59
SS -- Second number, 00 to 59
The struct tm is of the form:
struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;}
-------------------------------------------------------------------------------------*/
static char tempString[64];
struct w {
char month[4];
char day[4];
} words[12] = { {"Jan", "Sun"}, {"Feb", "Mon"}, {"Mar", "Tue"},
{"Apr", "Wed"}, {"May", "Thu"}, {"Jun", "Fri"},
{"Jul", "Sat"}, {"Aug", "Sun"}, {"Sep", "Mon"},
{"Oct", "Tue"}, {"Nov", "Wed"}, {"Dec", "Thu"} };
// Create the character string using a single format function call,
// accessing the appropriate struct tm variables, and the words
// in the above structure
sprintf (&tempString[0], "%s %i %s %i %02i:%02i:%02i",
words[(*tmPtr).tm_wday].day, (*tmPtr).tm_mday,
words[(*tmPtr).tm_mon].month, 1900+(*tmPtr).tm_year,
(*tmPtr).tm_hour, (*tmPtr).tm_min, (*tmPtr).tm_sec );
// Return a pointer to the string
return tempString;
}