Author Topic: Timestamp in Torque  (Read 593 times)

How to retrieve the time in Torque?

Is it a function where you input m/d/y, like that?

Code: [Select]
function getTime()
{
%datetime= getDateTime();
%parsepos = strstr(getDateTime()," ");
%timesingular= getSubStr(getDateTime(),%parsepos,999);
%datesingular= strReplace(%datetime,%timesingular,"");
return %timesingular;
}

Wow, 8 lines of code compressed to 1:

restWords(getDateTime());

(Also it looks like yours leaves a space at the beginning of whatever it returns...)
« Last Edit: March 06, 2009, 07:08:31 PM by Ephialtes »


And I supposed the date?

Nevermind, just leave off the restWords()

Also in combination with firstWord()
« Last Edit: March 06, 2009, 09:52:52 PM by Kalphiter »