Login Page - Create Account

Support Board


Date/Time: Thu, 18 Apr 2024 21:27:35 +0000



ACSIL - Formating a string that includes a SCDateTime type variable

View Count: 2318

[2018-02-26 18:13:09]
Zosimus - Posts: 345
Which specifier should I use for a SCDateTime variable when formating a string that icludes such a variable?. %f doesn't seem to be the correct specfier (SCDatetime is a double precision variable)
example:
SCString str;
str.Format("DateTime = %?", sc.BaseDateTimeIn[sc.Index])
Which specifier should come instead of the question mark?
[2019-03-08 23:07:43]
Andy Sureway - Posts: 93
Today I also run into this problem. It seems that this fundamental functionality is missing.
[2019-03-09 15:17:12]
bradh - Posts: 853
This should work:

SCString IndexDateTime = sc.DateTimeToString(sc.BaseDateTimeIn[Index], FLAG_DT_COMPLETE_DATETIME);

[2019-03-13 23:12:03]
Sierra Chart Engineering - Posts: 104368
Here is the documentation:
sc.DateTimeToString()

When using the string Format function you would want to use %f if you want to actually see the internal numeric value of a SCDateTime type.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2019-03-13 23:13:28

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account