Working with the SCDateTime Variables and Values


Introduction

The SCDateTime data type is used for Date-Time values in the ACSIL (Advanced Custom Study Interface and Language).

The internal representation of Date-Time values in this data type is exactly the same as the Date-Time values used in Microsoft Excel and Libre Office Calc.

There are various independent global functions and member functions of the SCDateTime type which makes it easy to work with these values. This page documents these functions.

SCDateTime Variables

A SCDateTime variable contains a Date and Time value as a double precision floating-point number.

A SCDateTime variable can be sc.BaseDateTimeIn[], sc.DateTimeOut[], or a locally defined SCDateTime variable.

Refer to the examples given below.

Throughout the documentation and examples you will see the variable, SCDateTimeVariable being used. This is a SCDateTime variable.

The following operators are supported with SCDateTime variables: = , += , -= , == , != ,< , <= , > , >=.

A SCDateTime variable contains a number which represents a Date and Time. The Date is represented by the integer portion of this number and the Time is represented by the fractional portion of the number.

Example Code

SCDateTime MySCDateTime; //Locally defined SCDateTime variable.

//MySCDateTime will contain, with this function call, the specified date time.
MySCDateTime.SetDateTimeYMDHMS(2007, 1, 30, 16, 10, 0);

int Hour, Minute, Second;
sc.BaseDateTimeIn[].GetTimeHMS(Hour, Minute, Second);

sc.DateTimeOut[].SetDateTimeYMDHMS(2007, 1, 30, 16, 10, 0);
            

SCDateTimeMS Variables

A SCDateTimeMS variable contains a Date and Time value as a double precision floating-point number. It is identical to and supports the same member functions as SCDateTime Variables. The difference is that all comparisons to this type of variable are done to the millisecond rather than to the second.

The following operators are supported with SCDateTimeMS variables and are done with millisecond precision: == , != ,< , <= , > , >=.

Internally the SCDateTimeMS variable stores the Date-Time value as a C++ double data type. Therefore, a SCDateTimeMS value can be assigned to a double variable. You can also store these SCDateTimeMS variables as persistent variables by using the sc.GetPersistentDouble and sc.SetPersistentDouble functions.

Date Values

Date values are integer (int) values representing the number of days since December 30, 1899.

You can get a Date Value from a SCDateTime variable by using the GetDate() member function, or by using the DATE_PART() function and pass a SCDateTime variable.

You can set the date part of a SCDateTime variable by using the SetDate() member function, or through the COMBINE_DATE_TIME() function.

You can construct a Date Value from Year, Month, Day components by using the YMD_DATE() function, and deconstruct a Date Value using the DATE_TO_YMD() function.

Time Values

Time values are integer (int) values representing the number of seconds since midnight (00:00).

You can get a Time Value from a SCDateTime variable by using the GetTime() member function, or the TIME_PART() function.

You can set the time part of a SCDateTime variable by using the SetTime() member function, or through the COMBINE_DATE_TIME() function.

You can construct a Time Value from Hour, Minute, Second components by using the HMS_TIME() function, and deconstruct a Time Value using the TIME_TO_HMS() function.

Within a SCDateTime variable, the Time is represented by the fractional portion of the internal double precision floating-point number. It is a fraction of 1 day. Each second is equivalent to 1/86400.0 or 0.0000115741.

Valid Ranges

The valid ranges for the date and time components in a SCDateTime variable are:

  • Year: Four digit year. Example: 2012.
  • Month: 1 through 12.
  • Day: 1 through [days in month].
  • Hour: 0 through 23.
  • Minute: 0 through 59.
  • Second: 0 through 59.
  • Millisecond: 0 through 999.
  • Microsecond: 0 through 999.

SCDateTime Member Functions

GetDate()

Type: SCDateTime member function.

int GetDate();

GetDate() returns the date part of the SCDateTime variable. The value returned is a Date Value.

Example Code

int Date = SCDateTimeVariable.GetDate();
            

GetDateTimeYMDHMS()

Type: SCDateTime member function

void GetDateTimeYMDHMS(int& Year, int& Month, int& Day, int& Hour, int& Minute, int& Second);

GetDateTimeYMDHMS() gets the year, month, day, hour, minute, and second components of the SCDateTime variable. The function will set the Year, Month, Day, Hour, Minute, and Second variables provided as parameters.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int Year, Month, Day, Hour, Minute, Second;

SCDateTimeVariable.GetDateTimeYMDHMS(Year, Month, Day, Hour, Minute, Second);
            

GetDateTimeYMDHMS_MS()

Type: SCDateTime member function

void GetDateTimeYMDHMS_MS(int& Year, int& Month, int& Day, int& Hour, int& Minute, int& Second, int& MilliSecond);

GetDateTimeYMDHMS_MS() gets the year, month, day, hour, minute, second, and millisecond components of the SCDateTime variable. The function will set the Year, Month, Day, Hour, Minute, Second, and MilliSecond variables provided as parameters.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int Year, Month, Day, Hour, Minute, Second, MilliSecond;

SCDateTimeVariable.GetDateTimeYMDHMS_MS(Year, Month, Day, Hour, Minute, Second, MilliSecond);
            

GetDateYMD()

Type: SCDateTime member function

void GetDateYMD(int& Year, int& Month, int& Day);

GetDateYMD() gets the year, month, and day components of the SCDateTime variable. The function will set the Year, Month, and Day variables provided as parameters.

Refer to the Valid Ranges section for the range of values returned.

Example Code

SCDateTimeVariable.GetDateYMD(Year, Month, Day);
            

GetDay()

Type: SCDateTime member function

int GetDay();

GetDay() returns an integer value representing the day of the SCDateTime variable.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int Day = sc.BaseDateTimeIn[sc.Index].GetDay();     
		

GetDayOfWeek()

Type: SCDateTime member function

int GetDayOfWeek();

GetDayOfWeek() returns the day of the week for the SCDateTime variable. The return value will be one of the following: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY.

Example Code

if (SCDateTimeVariable.GetDayOfWeek() == MONDAY)
{
    // SCDateTimeVariable is a Monday
}
			

GetHour()

Type: SCDateTime member function

int GetHour();

GetHour() returns an integer value representing the hour of the SCDateTime variable.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int Hour = sc.BaseDateTimeIn[sc.Index].GetHour();
			

GetMicroSecond()

Type: SCDateTime member function

int GetMicroSecond();

GetMicroSecond() returns an integer value representing the microsecond of the SCDateTime variable.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int MicroSecond = sc.BaseDateTimeIn[sc.Index].GetMicroSecond();
			

GetMilliSecond()

Type: SCDateTime member function

int GetMilliSecond();

GetMilliSecond() returns the milliseconds portion of the Date-Time variable.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int MilliSecond = sc.BaseDateTimeIn[sc.Index].GetMilliSecond();
			

GetMinute()

Type: SCDateTime member function

int GetMinute();

GetMinute() returns an integer value representing the minute of the SCDateTime variable.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int Minute = sc.BaseDateTimeIn[sc.Index].GetMinute();
			

GetMonth()

Type: SCDateTime member function

int GetMonth();

GetMonth() returns an integer value representing the month of the SCDateTime variable.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int Month = sc.BaseDateTimeIn[sc.Index].GetMonth();       
		

GetSecond()

Type: SCDateTime member function

int GetSecond();

GetSecond() returns an integer value representing the second of the SCDateTime variable.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int Second = sc.BaseDateTimeIn[sc.Index].GetSecond();
			

GetTime()

Type: SCDateTime member function

int GetTime();

GetTime() returns the time part of the SCDateTime variable. The value returned is a Time Value.

Example Code

int Time = SCDateTimeVariable.GetTime();
            

GetTimeAsSCDateTime()

Type: SCDateTime member function

SCDateTime GetTimeAsSCDateTime();

GetTimeAsSCDateTime() returns the time part of the SCDateTime variable. The value returned is a SCDateTime variable.

Example Code

SCDateTime TimeOnly = SCDateTimeVariable.GetTimeAsSCDateTime();
            

GetTimeHMS()

Type: SCDateTime member function

void GetTimeHMS(int& Hour, int& Minute, int& Second);

GetTimeHMS() gets the hour, minute, and second components of the SCDateTime variable. The function will set the Hour, Minute, and Second variables provided as parameters.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int Hour, Minute, Second;

SCDateTimeVariable.GetTimeHMS(Hour, Minute, Second);
            

GetTimeWithoutMilliseconds()

Type: SCDateTime member function

int GetTimeWithoutMilliseconds();

GetTimeWithoutMilliseconds() returns the time part of the SCDateTime variable without the milliseconds part. The value returned is a Time Value.

The given value is rounded to the nearest millisecond, and then the millisecond component is discarded so that the value is truncated to the containing second.

Example Code

int Time = SCDateTimeVariable.GetTimeWithoutMilliseconds();
            

GetYear()

Type: SCDateTime member function

int GetYear();

GetYear() returns an integer value representing the year of the SCDateTime variable.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int Year = sc.BaseDateTimeIn[sc.Index].GetYear();            
			

IsSaturday()

Type: SCDateTime member function

int IsSaturday();

IsSaturday() returns an boolean value (true or false) depending on whether the day of the week for the SCDateTime variable is SATURDAY.

IsSunday()

Type: SCDateTime member function

int IsSunday();

IsSunday() returns an boolean value (true or false) depending on whether the day of the week for the SCDateTime variable is SUNDAY.

IsWeekend()

Type: SCDateTime member function

int IsWeekend();

IsWeekend() returns an boolean value (true or false) depending on whether the day of the week for the SCDateTime variable is a weekend day (SATURDAY or SUNDAY).

RoundDateTimeDownToMilliSecond()

Type: SCDateTime member function

void RoundDateTimeDownToMilliSecond();

The RoundDateTimeDownToMilliSecond() function rounds down the Date-Time value contained within the SCDateTime variable to the millisecond and removes the microseconds. Therefore, the microseconds will be zero.

Example Code

SCDateTime BarDateTime = sc.BaseDateTimeIn[sc.Index];
BarDateTime.RoundDateTimeDownToMilliSecond();
			

RoundDateTimeDownToMinute()

Type: SCDateTime member function

void RoundDateTimeDownToMinute();

The RoundDateTimeDownToMinute() function rounds down the Date-Time value contained within the SCDateTime variable to the minute and removes the seconds. Therefore, the seconds will be zero.

Example Code

SCDateTime BarDateTime = sc.BaseDateTimeIn[sc.Index];
BarDateTime.RoundDateTimeDownToMinute();
			

RoundDateTimeDownToSecond()

Type: SCDateTime member function

void RoundDateTimeDownToSecond();

The RoundDateTimeDownToSecond() function rounds down the Date-Time value contained within the SCDateTime variable to the second and removes the milliseconds. Therefore, the milliseconds will be zero.

Example Code

SCDateTime BarDateTime = sc.BaseDateTimeIn[sc.Index];
BarDateTime.RoundDateTimeDownToSecond();
			

RoundToNearestMilliSecond()

Type: SCDateTime member function

void RoundToNearestMilliSecond();

The RoundToNearestMilliSecond() function rounds the Date-Time value contained within the SCDateTime variable to the nearest millisecond and removes the microseconds. Therefore, the microseconds will be zero.

Example Code

SCDateTime BarDateTime = sc.BaseDateTimeIn[sc.Index];
BarDateTime.RoundToNearestMilliSecond();
			

RoundToNearestSecond()

Type: SCDateTime member function

void RoundToNearestSecond();

The RoundToNearestSecond() function rounds the Date-Time value contained within the SCDateTime variable to the nearest second and removes the milliseconds. Therefore, the milliseconds will be zero.

Example Code

SCDateTime BarDateTime = sc.BaseDateTimeIn[sc.Index];
BarDateTime.RoundToNearestSecond();
			

SCDateTime()

Type: SCDateTime constructor.

SCDateTime();

SCDateTime(double DateTime );

SCDateTime(const SCDateTime & DateTime);

SCDateTime(int DateValue, int TimeValue);

SCDateTime(int Year, int Month, int Day, int Hour, int Minute, int Second);

SCDateTime() is the constructor function that sets a SCDateTime variable. Using the different constructors, we can easily assign the Year, Month, Day, Hour, Minute and Second values to the SCDateTime variable.

Refer to the Valid Ranges section for valid values that can be used.

Example Code

SCDateTime DateTime(2012, 1, 1, 12, 0, 0);
            

SetDate()

Type: SCDateTime member function

SCDateTime& SetDate(int Date);

SetDate() sets the date part of the SCDateTime variable with the given Date. Date must be given as a Date Value.

Example Code

int DateValue = YMD_DATE(2007, 1, 30);

SCDateTimeVariable.SetDate(DateValue);
        

SetDateTime()

Type: SCDateTime member function

int SetDateTime(int Date, int Time);

SetDateTime() sets the SCDateTime variable with the given Date and Time components. Date must be given as a Date Value, and Time must be given as a Time Value.

Example Code

int DateValue = YMD_DATE(2007, 1, 30);
int TimeValue = HMS_TIME(16, 10, 0);
SCDateTimeVariable.SetDateTime(DateValue, TimeValue);
        

SetDateTimeYMDHMS()

Type: SCDateTime member function

SCDateTime& SetDateTimeYMDHMS(int Year, int Month, int Day, int Hour, int Minute, int Second);

SetDateTimeYMDHMS() sets the SCDateTime variable with the given Year, Month, Day, Hour, Minute, and Second components.

Refer to the Valid Ranges section for valid values that can be used.

Example Code

SCDateTimeVariable.SetDateTimeYMDHMS(2007, 1, 30, 16, 10, 0);
			

SetDateTimeYMDHMS_MS()

Type: SCDateTime member function

SCDateTime& SetDateTimeYMDHMS_MS(int Year, int Month, int Day, int Hour, int Minute, int Second, int MilliSecond);

SetDateTimeYMDHMS_MS() sets the SCDateTime variable with the given Year, Month, Day, Hour, Minute, Second, and MilliSecond components.

Refer to the Valid Ranges section for valid values that can be used.

Example Code

SCDateTimeVariable.SetDateTimeYMDHMS_MS(2007, 1, 30, 16, 10, 0, 0);
			

SetDateYMD()

Type: SCDateTime member function

SCDateTime& SetDateYMD(int Year, int Month, int Day);

SetDateYMD() sets the date part of the SCDateTime variable with the given Year, Month, and Day components.

Refer to the Valid Ranges section for valid values that can be used.

Example Code

SCDateTimeVariable.SetDateYMD(2007, 1, 30);
			

SetTime()

Type: SCDateTime member function

SCDateTime& SetTime(int Time);

SetTime() sets the time part of the SCDateTime variable with the given Time. Time must be given as a Time Value.

Example Code

int TimeValue = HMS_TIME(16, 10, 0);

SCDateTimeVariable.SetTime(TimeValue);
			

SetTimeHMS()

Type: SCDateTime member function

SCDateTime& SetTimeHMS(int Hour, int Minute, int Second);

SetTimeHMS() sets the time part of the SCDateTime variable with the given Hour, Minute, and Second components. The existing date in the variable is not changed and left as is.

Refer to the Valid Ranges section for valid values that can be used.

Example Code

SCDateTimeVariable.SetTimeHMS(16, 10, 0);
			

SetTimeHMS_MS()

Type: SCDateTime member function

SCDateTime& SetTimeHMS_MS(int Hour, int Minute, int Second, int MilliSecond);

SetTimeHMS_MS() sets the time part of the SCDateTime variable with the given Hour, Minute, Second, and MilliSecond components. The existing date in the variable is not changed and left as is.

Refer to the Valid Ranges section for valid values that can be used.

Example Code

SCDateTimeVariable.SetTimeHMS_MS(16, 10, 0, 0);
			

Date and Time Functions

DATE_PART()

Type: Function

DATE_PART(SCDateTimeVariable)

DATE_PART() returns the date part of an SCDateTime value given by SCDateTimeVariable. The value returned is a Date Value.

Example Code

int Date = DATE_PART(SCDateTimeVariable);
			

TIME_PART()

Type: Function

TIME_PART(SCDateTimeVariable)

TIME_PART() returns the time part of a SCDateTime value given by SCDateTimeVariable. The value returned is a Time Value.

Example Code

int Time = TIME_PART(SCDateTimeVariable);
			

COMBINE_DATE_TIME()

Type: Function

SCDateTime COMBINE_DATE_TIME(Date, Time)

COMBINE_DATE_TIME() returns a SCDateTime Variable constructed from the Date and Time given. Date must be given as a Date Value, and Time must be given as a Time Value.

Example Code

int DateValue = YMD_DATE(2007, 1, 30);

int TimeValue = HMS_TIME(16, 10, 0);

SCDateTime SCDateTimeVariable = COMBINE_DATE_TIME(DateValue, TimeValue);
			

DAY_OF_WEEK()

Type: Function

DAY_OF_WEEK(DateTimeVariable)

DAY_OF_WEEK() returns the day of the week for the given DateTimeVariable. DateTimeVariable can be either a SCDateTimeVariable, or a Date Value. The return value will be one of the following integer constants: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY.

Example Code

if (DAY_OF_WEEK(sc.BaseDateTime[sc.Index]) == MONDAY)
{

    // DateValue Is a Monday
}
			

HMS_TIME()

Type: Function

HMS_TIME(Hour, Minute, Second)

HMS_TIME() constructs a Time Value from the given Hour, Minute, and Second components.

Refer to the Valid Ranges section for valid values that can be used.

Example Code

int Time = HMS_TIME(16, 10, 0);
			

TIME_TO_HMS()

Type: Function

TIME_TO_HMS(Time, Hour, Minute, Second)

TIME_TO_HMS() gets the Hour, Minute, and Second components of the Time that is given. Time must be a Time Value.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int Hour, Minute, Second;

TIME_TO_HMS(TimeValue, Hour, Minute, Second);
			

YMD_DATE()

Type: Function

YMD_DATE(Year, Month, Day)

YMD_DATE() constructs a Date Value with the Year, Month, and Day components that are given. The Date Value returned can be assigned to a SCDateTime Variable.

Refer to the Valid Ranges section for valid values that can be used.

Example Code

int Date = YMD_DATE(2007, 1, 30);

SCDateTime MyDate = YMD_DATE(2007, 1, 30);
			

DATE_TO_YMD()

Type: Function

DATE_TO_YMD(Date, Year, Month, Day)

DATE_TO_YMD() gets the Year, Month, and Day components of the Date that is given. Date is a Date Value.

Refer to the Valid Ranges section for the range of values returned.

Example Code

int Year, Month, Day;

DATE_TO_YMD(DateValue, Year, Month, Day);
			

YMDHMS_DATETIME()

Type: Function

YMDHMS_DATETIME(Year, Month, Day, Hour, Minute, Second)

YMDHMS_DATETIME() constructs a SCDateTime Variable from the Year, Month, Day, Hour, Minute, and Second components given.

Refer to the Valid Ranges section for valid values that can be used.

Example Code

SCDateTime DateTime = YMDHMS_DATETIME(2007, 1, 30, 16, 10, 0);
			

DATETIME_TO_YMDHMS()

Type: Function

DATETIME_TO_YMDHMS(SCDateTimeVariable, Year, Month, Day, Hour, Minute, Second)

DATETIME_TO_YMDHMS() gets the Year, Month, Day, Hour, Minute, and Second components from the given SCDateTimeVariable.

Refer to the Valid Ranges section for range of values returned.

Example Code

int Year, Month, Day, Hour, Minute, Second;

SCDateTime DateTime = YMDHMS_DATETIME(2007, 1, 30, 16, 10, 0);

DATETIME_TO_YMDHMS(DateTime, Year, Month, Day, Hour, Minute, Second)
			

DaysInDateSpanNotIncludingWeekends()

Type: Function

int DaysInDateSpanNotIncludingWeekends(int FirstDate, int LastDate)

The DaysInDateSpanNotIncludingWeekends() function calculates the number of days within the date span specified by the FirstDate and the LastDate parameters, not including Saturday and Sunday. The calculation includes both of these dates as well. Both of these parameters are Date Values.

Example Code

int NumberOfDays = DaysInDateSpanNotIncludingWeekends(sc.BaseDateTimeIn[sc.Index - 100].GetDate(), sc.BaseDateTimeIn[sc.Index].GetDate());
			

Working With SCDateTime Arrays

When working with the sc.BaseDateTimeIn[] array, you can use several different methods for getting the date and/or time parts from elements in the array. These methods are given below.

Using the DATE_PART and TIME_PART functions

// Get the date of the bar at the current index
int CurrentBarDate = DATE_PART(sc.BaseDateTimeIn[sc.Index]);

// Get the time of the bar at the current index
int CurrentBarTime = TIME_PART(sc.BaseDateTimeIn[sc.Index]);
			

Using the GetDate() and GetTime() member functions of a SCDateTime variable

// Get the date of the bar at the current index
int CurrentBarDate = sc.BaseDateTimeIn[sc.Index].GetDate();

// Get the time of the bar at the current index
int CurrentBarTime = sc.BaseDateTimeIn[sc.Index].GetTime();
			

Using the DateAt() and TimeAt() member functions of a SCDateTime array

// Get the date of the bar at the current index
int CurrentBarDate = sc.BaseDateTimeIn.DateAt(sc.Index);

// Get the time of the bar at the current index
int CurrentBarTime = sc.BaseDateTimeIn.TimeAt(sc.Index);			
			

Using the [] array operator on the sc.BaseDateTimeIn SCDateTime array to get the Date and Time

if (sc.BaseDateTimeIn[sc.Index] >= YMDHMS_DATETIME(2010, 1, 1, 14, 0, 0))
{
	//do something...
}			
			

DateAt()

Type: SCDateTimeArray member function

int DateAt(int Index);

DateAt() returns the date part of the SCDateTime variable at the given Index in the SCDateTime array. The value returned is a Date Value.

Example Code

// Get the date at the current index
int Date = sc.BaseDateTimeIn.DateAt(sc.Index);
			

TimeAt()

Type: SCDateTimeArray member function

int TimeAt(int Index);

TimeAt() returns the time part of the SCDateTime variable at the given Index in the SCDateTime array. The value returned is a Time Value.

Example Code

// Get the time at the current index
int Time = sc.BaseDateTimeIn.TimeAt(sc.Index);
			

SetDateAt()

Type: SCDateTimeArray member function

int SetDateAt(int Index, int Date);

SetDateAt() sets the date part of the DateTime variable at the given Index in the SCDateTime array. Date must be given as a Date Value. The value returned is the same value that is passed in for Date. This function must not be used on the sc.BaseDateTimeIn[] array. The only array you'll probably ever use this on is the sc.DateTimeOut[] array.

Example Code

// Set the date for a custom chart bar
int Date = sc.DateTimeOut.SetDateAt(CustomIndex,sc.BaseDateTimeIn[sc.Index].GetDate());
			

SetTimeAt()

Type: SCDateTimeArray member function

int SetTimeAt(int Index, int Time);

SetTimeAt() sets the time part of the DateTime variable at the given Index in the SCDateTime array. Time must be given as a Time Value. The value returned is the same value that is passed in for Time. This function must not be used on the sc.BaseDateTimeIn[] array. The only array you will need to use this on is the sc.DateTimeOut[] array.

Example Code

// Set the time for a custom chart bar
int Time = sc.DateTimeOut.SetTimeAt(CustomIndex,sc.BaseDateTimeIn[sc.Index].GetTime());
			

Using References

The SCDateTime reference type, SCDateTimeArrayRef, can be used to set a reference to a SCDateTimeArray array to simplify writing code. See the example below.

Example Code

SCDateTimeArrayRef DateTimes = sc.BaseDateTimeIn;
int Time;
Time = DateTimes[sc.Index].GetTime();
			

Date and Time Math

SCDateTime Variable Documentation

Adding 30 seconds to a SCDateTime variable

SCDateTimeVariable += 30*SECONDS;
			

Subtracting 5 minutes from a SCDateTime variable

SCDateTimeVariable -= 5*MINUTES;
			

Adding 1 hour to a SCDateTime variable

SCDateTimeVariable += 1*HOURS;
			

Adding 1 day to a SCDateTime variable

SCDateTimeVariable += 1*DAYS;
			

Adding 1 week to a SCDateTime variable

SCDateTimeVariable += 1*WEEKS;
			

Adding 1 year to a SCDateTime variable

SCDateTimeVariable += 1*YEARS;
			

*Last modified Thursday, 22nd September, 2016.