kpy
asked on
Date manipulation
How can I manipulate the date.
eg: how can I add days to the current system date?
eg: how can I add days to the current system date?
perl5:
perl -e 'print scalar(localtime(time + 60 * 60 * 24)), "\n"';
perl -e 'print scalar(localtime(time + 60 * 60 * 24)), "\n"';
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
date dammddHHMMccyy
If you want to find tomorrows date (and it's not near midnight the day before a daylight savings time switch)
you can add 86400 to time(2) before calling localtime(3)
time_t t;
char *c;
t = time(NULL);
t += 60*60*24;
c = asctime(localtime(&t));