Ok I figured it out. I lost all my files a long time ago, so I have been trying to restore what was.
UTILSC:
/** Calculate the REAL time passed between two time invervals.
* @param t2 The later time.
* @param t1 The earlier time.
* @retval time_info_data The real hours, days, months and years passed between t2 and t1. */
struct time_info_data* real_time_passed(time_t t2, time_t t1)
{
long secs;
static struct time_info_data now;
secs = t2 - t1;
now.seconds = (secs / (SECS_PER_REAL_MIN / 60)) % 60;/* 0..59 seconds */
secs -= (SECS_PER_REAL_MIN / 60) * now.seconds;
now.minutes = (secs / SECS_PER_REAL_MIN) % 60; /* 0..59 minutes */
secs -= SECS_PER_REAL_MIN * now.minutes;
now.hours = (secs / SECS_PER_REAL_HOUR) % 24; /* 0..23 hours */
secs -= SECS_PER_REAL_HOUR * now.hours;
now.day = (secs / SECS_PER_REAL_DAY) % 35; /* 0..34 days */
secs -= SECS_PER_REAL_DAY * now.day;
now.month = (secs / (SECS_PER_REAL_YEAR / 12)) % 12; /* 0..11 months */
secs -= (SECS_PER_REAL_YEAR / 12) * now.month;
now.year = (secs / SECS_PER_REAL_YEAR);
secs -= SECS_PER_REAL_YEAR * now.year;
return (&now);
}
UtILS.H:
/** The number of seconds in a real seconds. */
#define SECS_PER_REAL_SEC 60
/** The number of seconds in a real minute. */
#define SECS_PER_REAL_MIN 60
/** The number of seconds in a real hour. */
#define SECS_PER_REAL_HOUR (60*SECS_PER_REAL_MIN)
/** The number of seconds in a real day. */
#define SECS_PER_REAL_DAY (24*SECS_PER_REAL_HOUR)
/** The number of seconds in a real year. */
#define SECS_PER_REAL_YEAR (365*SECS_PER_REAL_DAY)
ACT.INFORMATIVE.C:
playing_time = *real_time_passed((time(0) - ch->player.time.logon) +
ch->player.time.played, 0);
send_to_char(ch, "PLAYTIME: %d year%s, %d day%s, %d hour%s, %d minute%s, and %d second%s\r\n\r\n",
playing_time.year, playing_time.year == 1 ? "" : "s",
playing_time.day, playing_time.day == 1 ? "" : "s",
playing_time.hours, playing_time.hours == 1 ? "" : "s",
playing_time.minutes, playing_time.minutes == 1 ? "" : "s",
playing_time.seconds, playing_time.seconds == 1 ? "" : "s");
This will show:
PLAYTIME: 0 years, 0 days, 0 hours, 32 minutes, and 37 seconds
Second will now be actual seconds or very close to it. You can check by typing score every second and it should up date. Mushclient has a great timer function that I checked with. I have a imp and a non immortal character that show good information.