Time Increments?

This is a discussion on Time Increments? within the C++ Programming forums, part of the General Programming Boards category; Hi, I want to increment the time i got from the system and print that on the screen. How would ...

  1. #1
    UW_COOP
    Guest

    Time Increments?

    Hi,

    I want to increment the time i got from the system and print that on the screen. How would i do taht?? I have this so far:

    time_t ct;
    struct tm * timeinfo;

    time(&ct);
    timeinfo = localtime(&ct);

    say time info is something like: "today 12:00:00" and i want to
    print out 12:02:05 (increment by 2 minutes and five seconds)

    How would i do so?

    Ryan

  2. #2
    Registered User
    Join Date
    Dec 2002
    Posts
    56
    This is probably overkill, but you could take a look at a SimpleTime class I wrote. (I'll try and post the code on that page when I get to it, until then you can download it.)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 26
    Last Post: 07-05-2010, 11:43 AM
  2. Replies: 11
    Last Post: 03-29-2009, 01:27 PM
  3. calculating user time and time elapsed
    By Neildadon in forum C++ Programming
    Replies: 0
    Last Post: 02-10-2003, 06:00 PM
  4. Is this really true or it's just science fiction?
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 145
    Last Post: 04-09-2002, 07:17 PM
  5. time class
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 12-11-2001, 10:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21