Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int ReadDate3(char *Peek) {
- if(!strcasecmp(Peek, "now"))
- return time(NULL);
- int Month, Day, Year;
- if(!Peek[0]) return -1;
- Month = strtol(Peek, &Peek, 10);
- if(*Peek=='/') Peek++;
- if(!Peek[0]) return -1;
- Day = strtol(Peek, &Peek, 10);
- if(*Peek=='/') Peek++;
- if(!Peek[0]) return -1;
- Year = strtol(Peek, NULL, 10);
- time_t RawTime;
- struct tm *TimeInfo;
- time( &RawTime );
- TimeInfo = localtime ( &RawTime );
- TimeInfo->tm_year = Year - 1900;
- TimeInfo->tm_mon = Month - 1;
- TimeInfo->tm_mday = Day;
- return mktime(TimeInfo);
- }
- int Days = abs(ReadDate3(word[i])-ReadDate3(word[i+1])) / 86400;
- xchat_commandf(ph, "%s %i days (%i weeks and %i days)", ReplyCmd, Days, Days/7, Days%7);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement