caused
2013-11-24 11:35:29
Hi,
is there a way to convert the system time from
GetSystemTime;
To a String that looks like 12:23:15.
So basicly A function like "TimetoStr" ??
greetings
masterBB
2013-11-24 11:48:27
Not sure what you are asking.
All information on get time functions:
http://villavu.com/forum/showthread.php?p=1255679#post1255679Time formatting functions:
https://github.com/SRL/SRL-6/blob/master/lib/utilities/time.simba#L68GetSystemTime formatting:
writeln(msToTime(GetSystemTime(), TIME_BARE));
caused
2013-11-24 12:46:25
Thanks I was looking for that. WOnder why simba doesnt implement datetostr and timetostr though.
masterBB
2013-11-24 16:48:53
From: caused
Thanks I was looking for that. WOnder why simba doesnt implement datetostr and timetostr though.
You're free to add them ;)
caused
2013-11-24 17:03:37
That would probably be 2 lines for someone familiar with the simba code :D
From: caused
That would probably be 2 lines for someone familiar with the simba code :D
You can actually get what you want via..
ConvertTime(18111111, h, m, s);
writeln(toStr(h)+' '+toStr(m)+' '+toStr(s));
5 1 51 :D
caused
2013-11-25 07:32:06
thanks though… This doesnt seem to work well.
program New;
var
h,m,s:integer;
begin
ConvertTime(GetSystemTime,h,m,s);
writeln(toStr(h)+' '+toStr(m)+' '+toStr(s));
end.
Output: 47 26 37
What does Getsystem time result ?.. So maybe I can convert it myself.. The MSDN article doesnt explain that well. :x
bonsai
2013-11-25 08:31:02
Are you trying to get the current local time? getsystemtime() returns the number of MS since you booted the machine, so not good for that purpose.
There is an SRL6 function theTime() which returns local time in a string. It uses DecodeTime(Now(), hour, min, sec, msec) to make the string.
I couldn't find decodetime() or now() in the documentation. The link masterBB provided has a good description of now() though.
caused
2013-11-25 10:37:00
Awesome decodetime works great. I knew the "now()" var. But didnt know it was implemented, since alot of other date functions are missing.
Thanks :)