Login Page - Create Account

Support Board


Date/Time: Sat, 18 May 2024 10:42:16 +0000



Post From: ACSIL convert string to time

[2016-06-27 23:51:49]
ejtrader - Posts: 688
Thanks SC Team.

I tried to use them with SCDateTime/SCDateTimeMS combination - in both the cases I am loosing the millisecond portion from the output. Do I have to any other functions to preserve the millisecond portion?


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

//Also tried with SCDateTime in place of SCDateTimeMS - but still missing milliseconds

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

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

SCDateTimeMS DateTime;
DateTime.SetDateTime(DateValue, TimeValue.GetTime());

SCString message;
message.Format("DateTime: %s", sc.DateTimeToString(DateTime, FLAG_DT_COMPLETE_DATETIME_MS).GetChars());
sc.AddMessageToLog(message, 0); // Got the output as DateTime: 2016-06-26 22:34:03.000


Date Time Of Last Edit: 2016-06-27 23:52:06