ctime && asctime(localtime())

From: Akuma/Chris Baggett/DOOMer (doomer@BAYOU.COM)
Date: 12/22/97


question.

Is there any reason for ctime/asctime to all of a sudden
go buggy?

I was attempting to log a simple string (similar to what typeing UPTIME
in the mud would produce) and for some reason
the Up since ___ part is always
the current time.

So i placed a few logs, and grep'd a bit for any possible changes to
boot_time and couldn't find any problems
I even kept a working backup copy on my home computer,
and it looks exactly the same except for the log()'s
it worked fine before. but now for some reason it's doing this.

here's the logs i placed.
in do_date
in the else { } block

log("boot_time = %d", (int)boot_time);
log("boot_time = %s", ctime(&boot_time));

and here's the output i got:

Dec 23 00:40:04 :: boot_time = 882855598
Dec 23 00:40:04 :: boot_time = Tue Dec 23 00:40:04 1997
Dec 23 00:40:04 :: boot_time = 882855598
Dec 23 00:40:04 :: boot_time = Tue Dec 23 00:40:04 1997
Dec 23 00:40:05 :: boot_time = 882855598
Dec 23 00:40:05 :: boot_time = Tue Dec 23 00:40:05 1997
Dec 23 00:40:06 :: boot_time = 882855598
Dec 23 00:40:06 :: boot_time = Tue Dec 23 00:40:06 1997
Dec 23 00:41:00 :: boot_time = 882855598
Dec 23 00:41:00 :: boot_time = Tue Dec 23 00:41:00 1997
Dec 23 00:42:00 :: boot_time = 882855598
Dec 23 00:42:00 :: boot_time = Tue Dec 23 00:42:00 1997
// and here's what gets me, i've waited almost TEN minutes
// and it STILL changes the string no matter what!?!?!
Dec 23 00:50:00 :: boot_time = 882855598
Dec 23 00:50:00 :: boot_time = Tue Dec 23 00:50:00 1997

the same thing happens if i change ctime() to asctime(localtime())
(seeing as how they are the same thing i couldn't see how they were different)

any clues on this one?
obviously i'm not changing boot_time anywhere, but the string is different
everytime i print it out.
WTF?
this is currently running fine on my mud.
it prints out the correct time and everything, but why not here?
the code hasn't been changed in any way, except for the log()'s
(and the ctime() thing)

any ideas would be helpful.

thanks.
Akuma the Raging Coder

  +------------------------------------------------------------+
  | "The poets talk about love, but what I talk about is DOOM, |
  |      because in the end, DOOM is all that counts." -       |
  |   Alex Machine/George Stark/Stephen King, The Dark Half    |
  |        "Nothing is IMPOSSIBLE, Just IMPROBABLE"            |
  |   "Easier Said Than Done, But Better Done Than Said..."    |
  +------------------------------------------------------------+


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST