Login Page - Create Account

Support Board


Date/Time: Fri, 04 Jul 2025 15:07:45 +0000



[Programming Help] - ACSIL sc.Input[].SetTimeAsSCDateTime()

View Count: 1027

[2020-08-06 08:26:56]
CMG - Posts: 179
Hello,

1. Should this function return a Timevalue or a SCDateTime?

sc.Input[1].SetTimeAsSCDateTime(0);

If 00:01 (12:01 am)is entered in the input of the study, the function is returning 60 which is the correct timevalue. Shouldn't it return something like 0.0006944444444444446?

2. Coulnt find how to convert a Timevalue to SCDateTime

Thanks
[2020-08-06 09:57:50]
User907968 - Posts: 840
You can use these functions to get the time data stored in your input:
ACSIL Interface Members - sc.Input Array: sc.Input[].GetTime()
ACSIL Interface Members - sc.Input Array: sc.Input[].GetDateTime()

You can read about TimeValue here:
Working with the SCDateTime Variables and Values: Time Values

You could, for example, set TimeValue of SCDateTime variable using this function:
Working with the SCDateTime Variables and Values: SetTime()
[2020-08-11 06:59:35]
CMG - Posts: 179
SC Support...

Refering to the original post: is this function working as described in the documentation? Is the return value correct (original post)?

Thanks
[2020-08-11 09:20:36]
User907968 - Posts: 840
Not SC Support, but...

The return type for sc.Input[].SetTimeAsSCDateTime() is SCInputRef, not TimeValue or SCDateTime. (ACSIL Interface Members - sc.Input Array: sc.Input[].SetTimeAsSCDateTime())

Which actual function is returning 60?

I have studies using the sc.Input[].SetTimeAsSCDateTime() function, these were compiled using v2107 headers and they work as expected.

When input is 00:01:00 -
sc.Input[].GetTime() returns 60 (int TimeValue)
&
sc.Input[].GetDateTime() returns 0.000694 (SCDateTime)
[2020-08-11 19:15:48]
Sierra Chart Engineering - Posts: 104368
Also refer to this page:
Working with the SCDateTime Variables and Values
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
[2020-08-11 21:16:29]
CMG - Posts: 179
907968 Thanks a lot for your answers,

Solved. I was using sc.Input[].GetTime() to get the input value from sc.Input[].SetTimeAsSCDateTime(). Now using sc.Input[].GetDateTime()

I thought sc.Input[].GetDateTime() was for sc.Input[].SetDateTime() only.

Thanks again

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

Login

Login Page - Create Account