Skip to main content
Version: 1.26.0

SimpleTime

This server class provides methods to operate the SimpleTime class objects. For example, use this class to create the SimpleTime object instances or work with the class fields.

SimpleTime(time)​


Use this constructor to instantiate a new SimpleTime object.

Parameter(s):

NameTypeMandatoryDefault value
timeIntegerN0

Example:

SimpleTime()
const reportTime = new SimpleTime();
ss.info(reportTime.getByFormat());
//Info: 03:00:00

getByFormat(format)​


Use this method to get time value in the format you need.

Parameter(s):

NameTypeMandatoryDefault value
formatStringN"H:i:s"

Return:

TypeDescription
StringThis method returns the time in the specified format.

Example:

getByFormat()
const reportTime = new SimpleTime();
reportTime.setValue('12:00:00');
ss.info(reportTime.getByFormat('H:i'));
//Info: 12:00

getDisplayValue()​


Use this method to get the time in the 'H:i:s' format.

Return:

TypeDescription
StringThis method returns the time in the 'H:i:s'format.

Example:

getDisplayValue()
const reportTime = new SimpleTime('12:00:00');
ss.info(reportTime.getDisplayValue());
//Info: 12:00:00

getHourLocalTime()​


Use this method to get the hours of the current time in the local time zone.

Return:

TypeDescription
StringThis method returns the hour(s) of the time.
getHourLocalTime()
const reportTime = new SimpleTime();
reportTime.setValue('12:00:00');
ss.info(reportTime.getHourLocalTime());
//Info: 12

getHourUTC()​


Use this method to get the hours of the current time in UTC.

Return:

TypeDescription
StringThis method returns the hour(s) of the time in UTC.
getHourUTC()
const startPoint = new SimpleTime();
startPoint.setValue('12:00:00');
ss.info(startPoint.getHourUTC());
//Info: 09

getValue()​


Use this method to get a time value stored in the SimpleTime object that has the internal format (‘H:i:s’) and is in the system time zone.

Return:

TypeDescription
StringThis method returns the time value.
getValue()
const startPoint = new SimpleTime('12:00:00');
ss.info(startPoint.getValue());
//Info: 09:00:00

setValue(time)​


Use this method to determine the time of the SimpleTime object in the current time zone.

Parameter(s):

NameTypeMandatoryDefault value
timeStringN"00:00:00"

Return:

TypeDescription
VoidThis method does not return a value.
setValue()
const startPoint = new SimpleTime();
startPoint.setValue('12:00:00');
ss.info(startPoint.getValue());
//Info: 09:00:00