You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

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
StringThe 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
StringThe time in '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
StringThe hour(s) of the time.

Example:

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
StringThe hour(s) of the time in UTC.

Example:

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
StringThe time value.

Example:

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.

Example:

setValue
const startPoint = new SimpleTime();
startPoint.setValue('12:00:00');
ss.info(startPoint.getValue());
//Info: 09:00:00

ParaphraseBasicCloseSynonymscontainscontains (verb)incorporatescomprisesincludesShow allAI-generated alternativesParaphrase your sentences with A.I.You need a shorter, more fluent, or more formal text? We’ve got you covered. Please consult our Privacy Policy regarding data processing.Accept Privacy Policy

  • No labels