This server class provides methods for performing operations with SimpleTime class objects, for example, for creating SimpleTime object instances or working with class fields.
SimpleTime(time)
Instantiates a new SimpleTime object.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
time | integer | N | 0 |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | SimpleTime |
---|
linenumbers | true |
---|
|
letconst streportTime = new SimpleTime(0);();
ss.info(reportTime.getByFormat());
//Info: 03:00:00 |
This method gets the time in the specified format.
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 |
---|
language | js |
---|
theme | Eclipse |
---|
title | getByFormat |
---|
linenumbers | true |
---|
|
letconst streportTime = new SimpleTime();
streportTime.setValue('12:00:00');
ss.info(streportTime.getByFormat('H:mi'));
// Info: 12:0100 |
getDisplayValue()
This method gets the time in the 'H:i:s' format.
Return:
Type | Description |
---|
String | The time in 'H:i:s'format. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getDisplayValue |
---|
linenumbers | true |
---|
|
letconst streportTime = new SimpleTime();
st.setValue('12:00:00');
ss.info(streportTime.getDisplayValue());
// Info: 12:00:00 |
getHourLocalTime()
This method returns the hours part of the time using the local time zone.
Return:
Type | Description |
---|
String | The hours part of the time. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getHourLocalTime |
---|
linenumbers | true |
---|
|
letconst streportTime = new SimpleTime();
streportTime.setValue('12:00:00');
ss.info(streportTime.getHourLocalTime());
// Info: 12 |
getHourUTC()
Returns the hours part of the time using the UTC time zone. The number of hours is based on 12-hour clock. Noon and midnight are shown as 0, not as 12.
Return:
Type | Description |
---|
String | The hours part of the time. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getHourUTC |
---|
linenumbers | true |
---|
|
letconst ststartPoint = new SimpleTime();
ststartPoint.setValue('12:00:00');
ss.info(ststartPoint.getHourUTC());
// Info: 09 |
getValue()
This method gets the time value stored in the database by the SimpleTime object, using the the internal format (‘H:i:s’) and the system time zone.
Return:
Type | Description |
---|
String | The time value. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getValue |
---|
linenumbers | true |
---|
|
letconst ststartPoint = new SimpleTime();
st.setValue('12:00:00');
ss.info(ststartPoint.getValue());
// Info: 09:00:00 |
setValue(time)
This method sets the time of the SimpleTime object in the internal 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 |
---|
language | js |
---|
theme | Eclipse |
---|
title | setValue |
---|
linenumbers | true |
---|
|
letconst ststartPoint = new SimpleTime();
ststartPoint.setValue('12:00:00');
ss.info(ststartPoint.getValue());
// Info: 09:00:00 |