F
Fernando
Hello,
I want do a program what find the date of the one before day at day what the
program run (if today is 20031030, the program will find 20031029). I have
the next:
#include <stdio.h>
#include <time.h>
int main() {
struct tm *ptr;
time_t ltime;
char str[80];
ltime = time(NULL); //return system time
ptr = localtime(<ime); // return time in the form of tm structure
strftime(str,80,"%Y%m%d",ptr);
printf("%s\n",str);
}
but I don´t know how substract one day at this array. Can someone help me?
Thaks
I want do a program what find the date of the one before day at day what the
program run (if today is 20031030, the program will find 20031029). I have
the next:
#include <stdio.h>
#include <time.h>
int main() {
struct tm *ptr;
time_t ltime;
char str[80];
ltime = time(NULL); //return system time
ptr = localtime(<ime); // return time in the form of tm structure
strftime(str,80,"%Y%m%d",ptr);
printf("%s\n",str);
}
but I don´t know how substract one day at this array. Can someone help me?
Thaks