Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    Get System Time()


    NeoIII
     Share

    Recommended Posts

    char *GetTime( )
    {
    struct tm * current_tm;
    time_t current_time;
    
    time (&current_time);
    current_tm = localtime (&current_time);
    
    
    char *logbuf = new char[ 256 ];
    
    
    	sprintf( logbuf, "[%02d:%02d:%02d]", current_tm->tm_hour, current_tm->tm_min, current_tm->tm_sec );
    return logbuf;
    }

     

    Return: [hh:mm:ss] --> [17:36:59]

     

    allways displays the current system time!!!

    Link to comment
    Share on other sites

    • 1 year later...
    • 2 months later...
    • 1 month later...
    • 5 weeks later...

    You can you GetTimeFormat(...) and GetDateFormat(...).

     

    Simpler and Easyer.

    Edited by Im V!rus
    Link to comment
    Share on other sites

    • 1 month later...

    #include "WinNls.h"
    
    void vMenu::DrawTimeAndDate()
    {
    if( vcvar->Settings.vDateAndTime )
    {
    	char Timestruct[16] = "hh':'mm':'ss tt"
    	char TimeString[25];
    	char Datestruct[12] = "d':'m':'y";	
    	char DateString[24];
    	GetTimeFormat(NULL,NULL,NULL,NULL,Timestruct,16);
    	GetDateFormat(NULL,NULL,NULL,NULL,Datestruct,12);
    	sprintf(TimeString,"[ %s ]",Timestruct);
    	sprintf(DateString,"[ %s ]",Datestruct);
    	pFont->m_FontColor = D3DCOLOR_XRGB( 0, 0, 0 ); // Black
    	pFont->DrawText( TimeString, 10, 10 );
    	pFont->DrawText( DateString, 120, 10 );
    }
    }

     

    So mach ich es...

    Ist direkt Datum mit dabei...

    Edited by Vulcanraven
    Link to comment
    Share on other sites

    • 1 year later...
    • 6 months later...
    • 4 weeks later...
    SYSTEMTIME sysTime = {0};
    GetLocalTime( &sysTime );
    //use:
    sysTime.wHour
    sysTime.wMinute 
    sysTime.wSecond
    sysTime.wMilliseconds

    Link to comment
    Share on other sites

    • 3 years later...

    your problem description is very weak, dont know how to help you that way...

     

    here is a sample on how you could do a counter, it actually just counts elapsed time since timerstart

     

    void cTools::SetTimerStart()
    {
       dwModuleStart = GetTickCount();
    }
    
    string cTools::GetElapsedTimeString()
    {
       DWORD total = ((GetTickCount() - dwModuleStart)/1000);
       DWORD hours = (total%86400)/3600;
       DWORD minutes = ((total%86400)%3600)/60;
       DWORD seconds = ((total%86400)%3600)%60;
    
       char logbuf[256] = {0};
       sprintf( logbuf, "[ %02d:%02d:%02d ]", hours, minutes, seconds );
       string sRet;
       sRet.clear();
       sRet.append(logbuf);
       return sRet;
    }
    

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...