![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SCO Backups and Verify Log | jfd7000 | SCO | 1 | 04-28-2008 10:49 AM |
| verify if a process exists (ps) | melanie_pfefer | Shell Programming and Scripting | 4 | 04-05-2008 04:34 PM |
| verify arguments | bebop1111116 | Shell Programming and Scripting | 2 | 09-19-2006 08:08 PM |
| Verify Parameters | lesstjm | Shell Programming and Scripting | 2 | 04-17-2003 04:59 PM |
| Solaris (verify 64 or 32 bit | witt | UNIX for Dummies Questions & Answers | 3 | 11-30-2001 12:46 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
print the curretime, add 20 days to it and see what you get:
Code:
#include <time.h>
void mytime(time_t *val)
{
struct tm *p=localtime(val);
char tmp[80]={0x0};
strftime(tmp, 80, "%d-%b-%Y:%H:%M:%S %Z", p);
printf("%s\n", tmp);
}
int main()
{
time_t lt=time(NULL);
mytime(<);
lt+=20*86400;
mytime(<);
return 0;
}
Code:
kcsdev:/home/jmcnama> cc dst.c kcsdev:/home/jmcnama> ./a.out 01-Mar-2007:10:31:25 MST 21-Mar-2007:11:31:25 MDT kcsdev:/home/jmcnama> |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|