Aero -- Fix Date/Time on Per Call Wav Files; #168

This commit is contained in:
lwvmobile
2023-10-24 14:36:23 -04:00
parent ab54b2f6f8
commit bc90ade337
2 changed files with 35 additions and 30 deletions

View File

@@ -29,23 +29,24 @@ char * getDateE(void) {
time_t t;
t = time(NULL);
to = localtime( & t);
strftime(datename, sizeof(datename), "%Y-%m-%d", to);
strftime(datename, sizeof(datename), "%Y%m%d", to);
curr2 = strtok(datename, " ");
return curr2;
}
char * getTimeE(void) //get pretty hh:mm:ss timestamp
//fix from YorgosTheodorakis fork -- https://github.com/YorgosTheodorakis/dsd-fme/commit/7884ee555521a887d388152b3b1f11f20433a94b
char * getTimeE(void) //get pretty hhmmss timestamp
{
char * curr = (char *) malloc(9);
time_t t = time(NULL);
char * curr;
char * stamp = asctime(localtime( & t));
curr = strtok(stamp, " ");
curr = strtok(NULL, " ");
curr = strtok(NULL, " ");
curr = strtok(NULL, " ");
struct tm * ptm = localtime(& t);
sprintf(
curr,
"%02d%02d%02d",
ptm->tm_hour,
ptm->tm_min,
ptm->tm_sec
);
return curr;
}