mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-26 23:59:30 +00:00
Merge pull request #1532 from GarageGames/pr/1143
[CLONE] More consolefunctions #1143
This commit is contained in:
commit
794f1b9536
7 changed files with 706 additions and 0 deletions
|
|
@ -202,6 +202,26 @@ DefineConsoleFunction( getRealTime, S32, (), , "()"
|
|||
return Platform::getRealMilliseconds();
|
||||
}
|
||||
|
||||
ConsoleFunction( getLocalTime, const char *, 1, 1, "Return the current local time as: weekday month day year hour min sec.\n\n"
|
||||
"Local time is platform defined.")
|
||||
{
|
||||
Platform::LocalTime lt;
|
||||
Platform::getLocalTime(lt);
|
||||
|
||||
static const U32 bufSize = 128;
|
||||
char *retBuffer = Con::getReturnBuffer(bufSize);
|
||||
dSprintf(retBuffer, bufSize, "%d %d %d %d %02d %02d %02d",
|
||||
lt.weekday,
|
||||
lt.month + 1,
|
||||
lt.monthday,
|
||||
lt.year + 1900,
|
||||
lt.hour,
|
||||
lt.min,
|
||||
lt.sec);
|
||||
|
||||
return retBuffer;
|
||||
}
|
||||
|
||||
ConsoleFunctionGroupEnd(Platform);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue