Login Page - Create Account

Support Board


Date/Time: Sat, 18 May 2024 11:28:40 +0000



Post From: ACSIL convert string to time

[2016-06-28 01:55:40]
ejtrader - Posts: 688
Thanks SC team.

For anyone looking for this in the future - this is the resulting code.


SCString DateString="2016-06-26";
SCString TimeString="22:34:03.005";

SCDateTimeMS DateValue;
DateValue = sc.DateStringToSCDateTime(DateString);

SCDateTimeMS TimeValue;
TimeValue = sc.TimeStringToSCDateTime(TimeString);

SCDateTimeMS DateTime = DateValue + TimeValue;

SCString message;
message.Format("DateTime: %s", sc.DateTimeToString(DateTime, FLAG_DT_COMPLETE_DATETIME_MS).GetChars());
sc.AddMessageToLog(message, 0);