// // RickDate // // Copyright (c) 1998 palindrome.net, a division // of NetWrench Tool Supply (www.netwrench.com). // // Permission granted to copy/spindle/mutilate given // that the above copyright statement remains intact. // // written by: bob mcwhirter (bob@palindrome.net) #include #include char fix(int tmp); char fix(int tmp) { if (tmp > 9) { // tmp += 55; // makes upper-case letters tmp += 87; // makes lower-case letters } else { tmp += 48; } return char(tmp); } int main() { time_t clock; time(&clock); struct tm *tm; tm = localtime(&clock); int year = tm->tm_year + 1900; // years since 1900 int month = tm->tm_mon+1; // 0-11 month int day = tm->tm_mday; // 1-31 day cout << fix(year/(36*36));; year = year % (36 *36); cout << fix(year/(36)); year = year % (36); cout << fix(year); cout << fix(month); cout << fix(day) << endl << flush; return 1; }