1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how can i change this code

Discussion in 'C' started by davidrt, Jun 23, 2007.

  1. davidrt

    davidrt New Member

    Joined:
    Jun 23, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    sorry for double posting, this is my code that shows current time how can i add codes to it that could add 30 minutes to the passed time?
    thanks a lot
    Code:
    #include <stdio.h>
    #include <time.h>
    
    int main(void)
    {
        time_t result;
    
        result = time(NULL);
        printf("%s%ju secs since the Epoch\n",
            asctime (localtime (&result)),
            (uintmax_t) result);
        return (0);
    }
    
    Edit by DaWei: added code tags
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    Thirty minutes is 1800 seconds. Add that to your initial value and convert as needed. Once more, please read the "Before you make a query" thread (right up there in the upper right corner) and learn to use code tags to preserve your formatting/indentation. I'm going to do it for you this time, but I ain't yo' mama.
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    davidrt, you have 4 thread relating to the same thing and please keep the things at one place to get better responses.
     

Share This Page