////////////////////////////////////////////////////////////////////////////
| 617 | } |
| 618 | ///////////////////////////////////////////////////////////////////////////////// |
| 619 | int CScriptObjectSystem::GetLocalOSTime(IFunctionHandler *pH) |
| 620 | { |
| 621 | CHECK_PARAMETERS(0); |
| 622 | //! Get time. |
| 623 | #if defined(LINUX) |
| 624 | time_t long_time = time( NULL ); |
| 625 | struct tm *newtime = localtime( &long_time ); /* Convert to local time. */ |
| 626 | #else |
| 627 | __time64_t long_time; |
| 628 | _time64( &long_time ); /* Get time as long integer. */ |
| 629 | struct tm *newtime = _localtime64( &long_time ); /* Convert to local time. */ |
| 630 | #endif |
| 631 | |
| 632 | float ftime = 0; |
| 633 | if (newtime) |
| 634 | { |
| 635 | m_pScriptTimeTable->BeginSetGetChain(); |
| 636 | m_pScriptTimeTable->SetValueChain("sec",newtime->tm_sec); |
| 637 | m_pScriptTimeTable->SetValueChain("min",newtime->tm_min); |
| 638 | m_pScriptTimeTable->SetValueChain("hour",newtime->tm_hour); |
| 639 | m_pScriptTimeTable->SetValueChain("isdst",newtime->tm_isdst); |
| 640 | m_pScriptTimeTable->SetValueChain("mday",newtime->tm_mday); |
| 641 | m_pScriptTimeTable->SetValueChain("wday",newtime->tm_wday); |
| 642 | m_pScriptTimeTable->SetValueChain("mon",newtime->tm_mon); |
| 643 | m_pScriptTimeTable->SetValueChain("yday",newtime->tm_yday); |
| 644 | m_pScriptTimeTable->SetValueChain("year",newtime->tm_year); |
| 645 | m_pScriptTimeTable->EndSetGetChain(); |
| 646 | } |
| 647 | return pH->EndFunction(m_pScriptTimeTable); |
| 648 | } |
| 649 | ///////////////////////////////////////////////////////////////////////////////// |
| 650 | ///////////////////////////////////////////////////////////////////////////////// |
| 651 | int CScriptObjectSystem::ShowConsole(IFunctionHandler *pH) |
nothing calls this directly
no test coverage detected