- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <time.h>
-
-
- #define DAYSEC 3600*24
-
- int main(int argc, char*argv[])
- {
- int off;
- char * stime;
-
- time_t now_time;
- time_t new_time;
-
- struct tm *pansctime;
-
- off = atoi(argv[1]);
- printf("%d\n", off);
-
- now_time=time(NULL);
- new_time=now_time+ off*DAYSEC;
- pansctime = localtime(&new_time);
-
- stime = asctime(pansctime);
-
- printf("%s\n", stime);
- return 0;
- }