Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
This server class contains 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):
Name | Type | Mandatory | Default value |
---|---|---|---|
time | integer | N | 0 |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
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):
Name | Type | Mandatory | Default value |
---|---|---|---|
format | string | N | "H:i:s" |
Return:
Type | Description |
---|---|
String | The time in the specified format. |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
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:
Type | Description |
---|---|
String | The time in 'H:i:s'format. |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
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:
Type | Description |
---|---|
String | The hour(s) of the time. |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
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:
Type | Description |
---|---|
String | The hour(s) of the time in UTC. |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
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:
Type | Description |
---|---|
String | The time value. |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
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):
Name | Type | Mandatory | Default value |
---|---|---|---|
time | String | N | "00:00:00" |
Return:
Type | Description |
---|---|
Void | This method does not return a value. |
Example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
const startPoint = new SimpleTime(); startPoint.setValue('12:00:00'); ss.info(startPoint.getValue()); //Info: 09:00:00 |
Table of Contents | ||||
---|---|---|---|---|
|
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