Си++ функция подскажите.

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by Tofy, 7 Apr 2011.

  1. Tofy

    Tofy New Member

    Joined:
    21 Nov 2010
    Messages:
    27
    Likes Received:
    0
    Reputations:
    0
    Нужна функция которая узнает время в данный момент .
     
  2. bird

    bird New Member

    Joined:
    1 Apr 2011
    Messages:
    1
    Likes Received:
    0
    Reputations:
    0
    можно так например
    Code:
    time_t lt=time('\0');
    tm *p;
    p=localtime(&lt);
    cout<<p->tm_hour<<':'<<p->tm_min<<':'<<p->tm_sec;
     
  3. rudi

    rudi Active Member

    Joined:
    3 Jun 2010
    Messages:
    492
    Likes Received:
    186
    Reputations:
    5
    вот

    #include <time.h>
    Long timer = time(NULL);


    узнаешь колл. секунд с 1970 года
     
  4. cupper

    cupper Elder - Старейшина

    Joined:
    6 Jun 2007
    Messages:
    369
    Likes Received:
    92
    Reputations:
    5
    в гугл
     
  5. ree4

    ree4 New Member

    Joined:
    9 Mar 2011
    Messages:
    28
    Likes Received:
    2
    Reputations:
    0
    Now();
     
  6. slesh

    slesh Elder - Старейшина

    Joined:
    5 Mar 2007
    Messages:
    2,702
    Likes Received:
    1,224
    Reputations:
    455
    WinAPI - GetLocalTime / GetSystemTime