Thread: System Time

  1. #1
    Microsoft. Who? MethodMan's Avatar
    Join Date
    Mar 2002
    Posts
    1,198

    System Time

    Hi

    I am going to be programming a database that will have events set up on specific days. If its a cetain number of days prior to the event, certain actions cannot be performed.

    Is there any way I can get the system time from the computer?

    What can I look up in the man pages?

    I will be using ANSI C.

    Thanks
    -MethodMan-

    Your Move:Life is a game, Play it; Life is a challenge, Meet it; Life is an opportunity, capture it.

    Homepage: http://www.freewebs.com/andy_moog/home.html

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Casual Visitor
    Join Date
    Oct 2001
    Posts
    350
    Try asctime. That will return a string containing the day of the week, day, and year. Perhaps that's what you need.
    I haven't used a compiler in ages, so please be gentle as I try to reacclimate myself. :P

  4. #4
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    strftime is similar to asctime, but it allows you to set your own template for the output.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  5. #5
    Microsoft. Who? MethodMan's Avatar
    Join Date
    Mar 2002
    Posts
    1,198
    Thats what I am looking for.

    Thanks.
    -MethodMan-

    Your Move:Life is a game, Play it; Life is a challenge, Meet it; Life is an opportunity, capture it.

    Homepage: http://www.freewebs.com/andy_moog/home.html

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Read and set\change system time
    By Hexxx in forum C++ Programming
    Replies: 9
    Last Post: 01-02-2006, 07:11 AM
  2. Replies: 4
    Last Post: 06-13-2005, 09:03 AM
  3. Current System Time (In Milliseconds)
    By IGAU in forum C Programming
    Replies: 10
    Last Post: 03-30-2004, 06:53 PM
  4. I apologize. Good bye.
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 05-03-2002, 06:51 PM
  5. how to ouput system date and time?
    By toaster in forum C++ Programming
    Replies: 1
    Last Post: 04-21-2002, 10:58 PM