Thread: Need Help with the time()....Function.

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    4

    Lightbulb Need Help with the time()....Function.

    Hi, what I am having problems with is the “time()” function or my time.h file.
    Basically what I am trying to do is separate part of the displayed date “FRI” and just print the separated part. I tried this:

    1) char *asctime( const struct tm *time); Did not work. .
    2) then char *asctime( const struct tm *time);
    Replacing *time with *tm_mday. Referring to the time.h file.

    A second question??

    below is a small program that I wrote to display the time. The “*/*/” line I put in afterwards and I now get the correct out put. Why do I need this?

    time_t tod_y;

    */*/ time(&tod_y);

    cout<<ctime(&tod_y)<<endl;


    and why do I get the line below when I don’t have that line in?

    Wed Dec 31 19:09:35 1969

    P.S. I all ways get the above output.

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    u should check out what ctime does!?
    ill check if i got time

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  2. Sending an email in C program
    By Moony in forum C Programming
    Replies: 28
    Last Post: 10-19-2006, 10:42 AM
  3. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  4. Replies: 5
    Last Post: 02-08-2003, 07:42 PM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM