Login Page - Create Account

Support Board


Date/Time: Fri, 10 May 2024 01:23:05 +0000



Post From: displaying milliseconds sc.CurrentSystemDateTimeMS

[2016-09-10 04:38:06]
User553714 - Posts: 184
Hi,

Can you please provide some information on sc.CurrentSystemDateTimeMS as I can't seem to find anything in the documentation which includes information on the Millisecond component of the time vale; everything seems to relate to HMS Minutes, Hours, seconds only without information on how to get the Milliseconds component which I think is the purpose of the sc.CurrentSystemDateTimeMS SC function? I have looked here http://www.sierrachart.com/index.php?page=doc/SCDateTime.html, searched for it's use in the ACS folder and also searched the support board but couldn't find anything.

I can get the HMS component easy enough, but not the millisecond component;
  // Get the hour, minute, second for the time
  DateTime = sc.CurrentSystemDateTimeMS;
  LastSystemTime = TIME_PART(DateTime);
  TIME_TO_HMS(LastSystemTime, Hour, Minute, Second);
  Time = HMS_TIME(Hour, Minute, Second);  //System Time in SECONDS from the LastSystemTime - Uses Variables Hour & Minute to calc
  TIME_TO_HMS(Time, Hour, Minute, Second);
  MessageString.Format("Hour: %d, Minute: %d, Second: %d", Hour, Minute, Second);
  sc.AddMessageToLog(MessageString, 1);


I am trying to display time as 14:24:14.656 so I can include a millisecond delay of my choosing using a while loop.

Any pointers will be appreciated