This class provides methods for performing operations on SimpleDateTime objects, such as instantiating objects, for example.
You can also use this class to perform date-time operations, such as calculations, formatting or converting between date-time formats.
SimpleDateTime(dateTime)
Instantiates a new SimpleDateTime object with the current date and time.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
dateTime | String | N | '' |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | SimpleDateTime |
---|
linenumbers | true |
---|
|
const nowDateTime = new SimpleDateTime();
//
const registrationDateTime = new SimpleDateTime(record.registration_datetime);
//
const yearStartDateTime = new SimpleDateTime('2019-01-01 00:00:00'); |
addDayssetValue(
daysdateTime)
This method adds a specified number of days to the current SimpleDateTime object. The negative value of the parameter will subtract the days.The method determines local date and time equivalent to the value saved by the SimpleDateTime object, then adds or subtracts the days using local date and time valuessets the date and time of the SimpleDateTime object.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
days | integer | Y | N |
Return:
dateTime | A string in the local time zone and the internal format of yyyy-MM-dd HH:mm:ss. | Y | N |
dateTime | A SimpleDateTime object, | Y | N |
dateTime | A JavaScript Number. It sets the value of the object using the Number value as milliseconds past January 1, 1970, 00:00:00. | Y | N |
Return:
Type | Description |
---|
Void | This method does not return a value. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | addDayssetValue |
---|
linenumbers | true |
---|
|
const registrationDateTimestartDateTime = new SimpleDateTime('2019-01-01 08:1200:1000');
registrationDateTimestartDateTime.addDays(3setValue('2020-01-01 12:00:00');
ss.info(registrationDateTimestartDateTime.getValue()); // 20192020-01-0401 0812:1200:1000 |
addMonthsaddSeconds(
monthsseconds)
This method adds a specified number of months seconds to the current SimpleDateTime object. The negative value of the parameter will subtract the months.
The method determines local date and time equivalent to the value saved by the SimpleDateTime object, then adds or subtracts the months using local date and time values.
Parameter(s):
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
months
Return:
Type | Description |
---|
Void | This method does not return a value. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | addMonthsaddSeconds |
---|
linenumbers | true |
---|
|
const registrationDateTime = new SimpleDateTime('2019-01-01 08:12:10');
registrationDateTime.addMonthsaddSeconds(-13600);
ss.info(registrationDateTime.getValue()); // 20182019-1201-01 0809:12:10 |
addSecondsaddDays(
secondsdays)
This method adds a specified number of seconds days to the current SimpleDateTime object. The negative value of the parameter will subtract the days.
The method determines local date and time equivalent to the value saved by the SimpleDateTime object, then adds or subtracts the days using local date and time values.
Parameter(Parameter(s):
Name | Type | Mandatory | Default Value |
---|
secondsdays | Integerinteger | Y | N |
Return:
Type | Description |
---|
Void | This method does not return a value. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | addSecondsaddDays |
---|
linenumbers | true |
---|
|
const registrationDateTime = new SimpleDateTime('2019-01-01 08:12:10');
registrationDateTime.addSecondsaddDays(36003);
ss.info(registrationDateTime.getValue()); // 2019-01-0104 0908:12:10 |
addWeeks(weeks)
This method adds a specified number of weeks to the current SimpleDateTime object. The negative value of the parameter will subtract the weeks.
The method determines local date and time equivalent to the value saved by the SimpleDateTime object, then adds or subtracts the weeks using local date and time values.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
weeks | Integer | Y | N |
Return:
Type | Description |
---|
Void | This method does not return a value. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | addWeeks |
---|
linenumbers | true |
---|
|
const registrationDateTime = new SimpleDateTime('2019-01-01 08:12:10');
registrationDateTime.addWeeks(1);
ss.info(registrationDateTime.getValue()); // 2019-01-08 08:12:10 |
addYearsaddMonths(
yearsmonths)
This method adds a specified number of years months to the current SimpleDateTime object. The negative value of the parameter will subtract the yearsmonths.
The method determines local date and time equivalent to the value saved by the SimpleDateTime object, then adds or subtracts the years months using local date and time values.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
years
Return:
Type | Description |
---|
Void | This method does not return a value. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | addYearsaddMonths |
---|
linenumbers | true |
---|
|
const contractStartDateTimeregistrationDateTime = new SimpleDateTime('2019-01-01 0008:0012:0010');
contractStartDateTimeregistrationDateTime.addYearsaddMonths(-1);
ss.info(contractStartDateTimeregistrationDateTime.getValue()); // 20202018-0112-01 0008:0012:0010 |
afteraddYears(
dateTimeyears)
This method allows to compare the date specified by the ‘dateTime‘ parameter with the current date. The method returns TRUE, if the current date is after the specified; otherwise returns FALSEadds a specified number of years to the current SimpleDateTime object. The negative value of the parameter will subtract the years.
The method determines local date and time equivalent to the value saved by the SimpleDateTime object, then adds or subtracts the years using local date and time values.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
dateTimeyears | SimpleDateTime objectInteger | Y | N |
Return:
BooleanThe method returns TRUE if the current date is later than the date specified by the parameter; otherwise, returns FALSEThis method does not return a value. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | afteraddYears |
---|
linenumbers | true |
---|
|
const startDateTimecontractStartDateTime = new SimpleDateTime('20182019-01-01 0700:5800:3500');
const endDateTime = new SimpleDateTime('2019-01-01 08:00:00');
const isStartLaterThanEnd = startDateTime.after(endDateTime);
ss.info(isStartLaterThanEndcontractStartDateTime.addYears(1);
ss.info(contractStartDateTime.getValue()); // false |
beforeafter(dateTime)
This method allows to compare the date specified by the ‘dateTime‘ parameter with the current date.The The method returns TRUE, if the current date is before after the specified; otherwise returns falseFALSE.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
dateTime | SimpleDateTime object | Y | N |
Return:
Type | Description |
---|
Boolean | The method returns TRUE if the current date is earlier later than the date specified by the parameter; otherwise, returns FALSE. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | beforeafter |
---|
linenumbers | true |
---|
|
const startDateTime = new SimpleDateTime('2018-01-01 07:58:35');
const endDateTime = new SimpleDateTime('2019-01-01 08:00:00');
const isStartBeforeEndisStartLaterThanEnd = startDateTime.beforeafter(endDateTime);
ss.info(isStartBeforeEndisStartLaterThanEnd); // truefalse |
compareTobefore(dateTime)
This method compares two date and time objects to determine whether they are equivalent or notallows to compare the date specified by the ‘dateTime‘ parameter with the current date.
The method returns TRUE, if the current date is before the specified; otherwise returns false.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
dateTime | SimpleDateTime object | Y | N |
Return:
Type | Description |
---|
0 | Dates are equal |
Boolean | The method returns TRUE if the current date is earlier than | 1 | Object's date is after the date specified | in by the parameter; otherwise, returns FALSE. |
-1 | Object's date is before the date specified in the parameter. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | compareTobefore |
---|
linenumbers | true |
---|
|
const firstDateTimestartDateTime = new SimpleDateTime('20192018-01-01 0807:0058:0035');
const secondDateTimeendDateTime = new SimpleDateTime('20182019-01-01 08:00:00');
const thirdDateTimeisStartBeforeEnd = new SimpleDateTime('2018-01-01 08:00:00'startDateTime.before(endDateTime);
ssss.info(thirdDateTime.compareTo(secondDateTime ))isStartBeforeEnd); // 0
ss.info(firstDateTime.compareTo(secondDateTime)); // 1
ss.info(secondDateTime.compareTo(firstDateTime)); // -1 |
equals(compareTo(dateTime)
This method compares a datetime with an existing value if they are equaltwo date and time objects to determine whether they are equivalent or not.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
dateTime | SimpleDateTime object. | Y | N |
Return:
Type | Description | Boolean | |
---|
0 | Dates are equal |
1 | Object's date is after the date specified in the parameter. |
-1 | Object's date is before the date specified in the parameter | This method returns TRUE if the date are equal; otherwise, it returns FALSE. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | equalscompareTo |
---|
linenumbers | true |
---|
|
const firstDateTime = new SimpleDateTime('2019-01-01 08:00:00');
const secondDateTime = new SimpleDateTime('2018-01-01 08:00:00');
const thirdDateTime = new SimpleDateTime('2018-01-01 08:00:00');
ss.info(firstDateTimethirdDateTime.equalscompareTo(secondDateTime )); // false0
ss.info(thirdDateTimefirstDateTime.equalscompareTo(secondDateTime)); // true |
getDate()
This method returns the date stored by the SimpleDateTime object, showed in the system time zone.1
ss.info(secondDateTime.compareTo(firstDateTime)); // -1 |
equals(dateTime)
This method compares a datetime with an existing value if they are equal.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
dateTime | SimpleDateTime object. | Y | N |
Return:
String | The date in the default timezoneBoolean | This method returns TRUE if the date are equal; otherwise, it returns FALSE. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getDateequals |
---|
linenumbers | true |
---|
|
const startDateTimefirstDateTime = new SimpleDateTime('2019-01-01 08:00:00');
ss.info(startDateTime.getDate()); // 2019-01-01 |
getDaysInMonthLocalTimeconst secondDateTime = new SimpleDateTime('2018-01-01 08:00:00');
const thirdDateTime = new SimpleDateTime('2018-01-01 08:00:00');
ss.info(firstDateTime.equals(secondDateTime)); // false
ss.info(thirdDateTime.equals(secondDateTime)); // true |
getValue()
This method returns the number of days in the month saved by the SimpleDateTime object, showed in the user's time zone.
Return:
gets the date and time value in the internal format.
Return:
Integer number of days valuedate and time value in the internal format. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getDaysInMonthLocalTimegetValue |
---|
linenumbers | true |
---|
|
const startDateTime = new SimpleDateTime('2019-01-01 08:00:00');
ss.info(startDateTime.getDaysInMonthLocalTimegetValue()); // 31 |
getDayOfMonthLocalTimegetDisplayValue()
This method returns the day of the month saved by the SimpleDateTime object, showed in the user's time zonegets the date and time value in the current user's display format and timezone.
Return:
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getDaysofMonthsLocalTimegetDisplayValue |
---|
linenumbers | true |
---|
|
const holidayDateTimestartDateTime = new SimpleDateTime('2019-01-0701 08:00:00');
ss.info(holidayDateTimestartDateTime.getDayOfMonthLocalTimegetDisplayValue()) ; // 7 |
getDayOfMonthUTCgetDate()
This method returns the day of the month saved date stored by the SimpleDateTime object, showed in the UTC system time zone.
Return:
Integer day of the month valuedate in the default timezone. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getDaysofMonthsLocalTimegetDate |
---|
linenumbers | true |
---|
|
const holidayDateTimestartDateTime = new SimpleDateTime('2019-01-0701 08:00:00');
ss.info(holidayDateTimestartDateTime.getDayOfMonthUTCgetDate()); // 7 |
getDayOfWeekLocalTimegetDaysInMonthLocalTime()
This method returns the day number of days in the week month saved by the SimpleDateTime object, showed in the user's time zone.
Return:
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getDayOfWeekLocalTimegetDaysInMonthLocalTime |
---|
linenumbers | true |
---|
|
const holidayDateTimestartDateTime = new SimpleDateTime('2019-01-0701 08:00:00');
ss.info(holidayDateTimestartDateTime.getDayOfWeekLocalTimegetDaysInMonthLocalTime()); // Mon31 |
getDayOfWeekUTC
getDayOfMonthLocalTime()
This method returns the day of the week month saved by the SimpleDateTime object, showed in the system user's time zone.
Return:
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getDayOfWeekUTCgetDaysofMonthsLocalTime |
---|
linenumbers | true |
---|
|
const holidayDateTime = new SimpleDateTime('2019-01-07 08:00:00');
ss.info(holidayDateTime.getDayOfWeekUTCgetDayOfMonthLocalTime()); // Mon7 |
getDaysInMonthUTCgetDayOfMonthUTC()
This method returns the number day of days in the month saved by the SimpleDateTime object, showed in the system UTC time zone.
Return:
Type | Description |
---|
Integer | The |
number days
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getDaysInMonthUTCgetDaysofMonthsLocalTime |
---|
linenumbers | true |
---|
|
var simple_date_timeconst holidayDateTime = new SimpleDateTime('2019-01-0107 08:00:00');
ss.info(simple_date_time.getDaysInMonthUTCholidayDateTime.getDayOfMonthUTC() ); // 317 |
getDisplayValuegetDayOfWeekLocalTime()
This method gets the date and time value in the current user's display format and timezonereturns the day of the week saved by the SimpleDateTime object, showed in the user's time zone.
Return:
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getDisplayValuegetDayOfWeekLocalTime |
---|
linenumbers | true |
---|
|
var simple_date_timeconst holidayDateTime = new SimpleDateTime('2019-01-0107 08:00:00');
ss.info( simple_date_time.getDisplayValueholidayDateTime.getDayOfWeekLocalTime() ) ; // 2019-01-01 11:00:00 |
getErrorMsggetDayOfWeekUTC()
This method gets the error message if returns the day of the week saved by the SimpleDateTime object was incorrect, showed in the system time zone.
Return:
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getErrorMsggetDayOfWeekUTC |
---|
linenumbers | true |
---|
|
var simple_date_timeconst holidayDateTime = new SimpleDateTime('2019-zz01-0107 08:00:00');
ss.info(simple_date_time.getErrorMsgholidayDateTime.getDayOfWeekUTC()); )// ; Mon |
getLocalDategetDaysInMonthUTC()
This method returns the date stored number of days in the month saved by the SimpleDateTime object, showed in the user's system time zone.
Return:
String date in the user's time zone
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getLocalDategetDaysInMonthUTC |
---|
linenumbers | true |
---|
|
var simple_date_timeconst startDateTime = new SimpleDateTime('2019-01-01 08:00:00');
ss.info(simple_date_time.getLocalDatestartDateTime.getDaysInMonthUTC() ); // 2019-01-01 |
getLocalTimeisValid()
This method returns a SimpleDateTime object that shows the time in the user's time zone.allows to determine if a specified value is a valid date and time.
Return:
SimpleDateTime time in the user's time zonemethod returns TRUE if the value is a valid date and time; otherwise, it returns . |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getLocalTimeisValid |
---|
linenumbers | true |
---|
|
var first_simple_date_timeconst startDateTime = new SimpleDateTime('2019-01-01 08:00:00');
var time = first_simple_date_time.getLocalTime();
ss.info( "My local time is " + time.getByFormat('h:m:s') ) ; // My local time is 02:01:00 |
getMonthLocalTimestartDateTime.setValue("2011-aa-01 00:00:00");
ss.info(startDateTime.isValid()); // false |
getErrorMsg()
This method returns the month saved by SimpleDateTime object, showed in the current user's time zonegets the error message if the SimpleDateTime object was incorrect.
Return:
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getMonthLocalTimegetErrorMsg |
---|
linenumbers | true |
---|
|
var simple_date_timeconst startDateTime = new SimpleDateTime('2019-01zz-01 08:00:00');
ss.info(simple_date_time.getMonthLocalTimestartDateTime.getErrorMsg() ); // January |
getMonthUTC DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given |
getLocalDate()
This method returns the month saved date stored by the SimpleDateTime object, showed in the system user's time zone.
Return:
value of the monthdate in the user's time zone. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getMonthUTCgetLocalDate |
---|
linenumbers | true |
---|
|
var first_simple_date_timeconst startDateTime = new SimpleDateTime('2019-01-01 08:00:00');
ss.info( first_simple_date_time.getMonthUTCstartDateTime.getLocalDate() ); // January |
getNumericValuegetLocalTime()
This method gets the timestamp which stores the amount of milliseconds since January 1, 1970, 00:00:00.returns a SimpleDateTime object that shows the time in the user's time zone.
Return:
Integer timestamp valuetime in the user's time zone. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getNumericValuegetLocalTime |
---|
linenumbers | true |
---|
|
var simple_date_timeconst startDateTime = new SimpleDateTime('2019-01-01 08:00:00');
const time = startDateTime.getLocalTime();
ss.info(simple_date_time.getNumericValue() ) ; // 1546318800 |
getTime "My local time is " + time.getByFormat('h:m:s')); // My local time is 02:01:00 |
getMonthLocalTime()
This method returns a the month saved by SimpleDateTime object that shows the piece of time of the SimpleDateTime object, showed in the current user's time zone.
Return:
SimpleDateTime Unix duration stamp
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getTimegetMonthLocalTime |
---|
linenumbers | true |
---|
|
var first_simple_date_time const startDateTime = new SimpleDateTime('2019-0112-0131 0823:0045:00');
var time = first_simple_date_time.getTime();
ss.info( timestartDateTime.getByFormat('h:m:s') getMonthLocalTime()); // 11:01:00 |
getValuegetMonthUTC()
This method gets the date and time value in the internal formatreturns the month saved by SimpleDateTime object, showed in the system time zone.
Return:
null | string date and time in internal format
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getValuegetMonthUTC |
---|
linenumbers | true |
---|
|
var first_simple_date_timeconst startDateTime = new SimpleDateTime('2019-0112-0131 0823:0045:00');
ss.info( first_simple_date_time.getValuestartDateTime.getMonthUTC() ); //2019-01-01 08:00:00 |
getWeekOfYearLocalTimegetNumericValue()
This method returns the number of the week saved by the SimpleDateTime object, showed in the user's time-zonegets the timestamp which stores the amount of milliseconds since January 1, 1970, 00:00:00.
Return:
Type | Description |
---|
Integer | The |
number of the current week
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getWeekOfYearLocalTimegetNumericValue |
---|
linenumbers | true |
---|
|
var first_simple_date_timeconst startDateTime = new SimpleDateTime('2019-01-01 08:00:00');
ss.info( first_simple_date_time.getWeekOfYearLocalTimestartDateTime.getNumericValue() ); // 11546329600 |
getWeekOfYearUTCgetTime()
This method returns a SimpleDateTime object that shows the number piece of time of the week saved by the SimpleDateTime object, showed in the system time-zone.
Return:
Integer number of the current week
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getWeekOfYearUTCgetTime |
---|
linenumbers | true |
---|
|
var first_simple_date_timeconst startDateTime = new SimpleDateTime('2019-01-01 08:00:00');
const time = startDateTime.getTime();
ss.info( first_simple_date_time.getWeekOfYearUTC() getByFormat('h:m:s')); // 1 |
getYearLocalTimegetWeekOfYearLocalTime()
This method returns the number of the year week saved by the SimpleDateTime object, showed in the user's time-zone.
Return:
Four-digit year valueThe number of the current week. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getYearLocalTimegetWeekOfYearLocalTime |
---|
linenumbers | true |
---|
|
const holidayDateTimestartDateTime = new SimpleDateTime('2019-12-31 23:45:00');
ss.info(holidayDateTimestartDateTime.getYearLocalTimegetWeekOfYearLocalTime()); // 20201 |
getYearUTCgetWeekOfYearUTC()
This method returns the year number of the week saved by the SimpleDateTime object, showed in the system time-zone.
Return:
Four-digit year valueThe number of the current week. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | getYearUTCgetWeekOfYearUTC |
---|
linenumbers | true |
---|
|
const holidayDateTimestartDateTime = new SimpleDateTime('2019-12-31 23:45:00');
ss.info(holidayDateTimestartDateTime.getYearUTCgetWeekOfYearUTC()); // 20191 |
isValidgetYearLocalTime()
This method allows to determine if a specified value is a valid date and time. returns the year saved by the SimpleDateTime object, showed in the user's time zone.
Return:
Boolean | The method returns TRUE if the value is a valid date and time; otherwise, it returns Integer | Four-digit year value. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | isValidgetYearLocalTime |
---|
linenumbers | true |
---|
|
var simple_date_timeconst holidayDateTime = new SimpleDateTime('2019-0112-0131 0823:0045:00');
simple_date_time.setDisplayValue("2011-aa-01 00:00:00");
ss.info(simple_date_time.isValid() ) ; ss.info(holidayDateTime.getYearLocalTime()); // false2020 |
setValuegetYearUTC(
dateTime)
This method sets the date and time of the SimpleDateTime object.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
dateTime | A string in the local time zone and the internal format of yyyy-MM-dd HH:mm:ss. | Y | N |
dateTime | A SimpleDateTime object, | Y | N |
dateTime | A JavaScript Number. It sets the value of the object using the Number value as milliseconds past January 1, 1970, 00:00:00. | Y | N |
returns the year saved by the SimpleDateTime object, showed in the system time zone.
Return:
Void | This method does not return a Integer | Four-digit year value. |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | setValuegetYearUTC |
---|
linenumbers | true |
---|
|
const startDateTimeholidayDateTime = new SimpleDateTime("'2019-0112-0131 0823:0045:00");
startDateTime.setValue('2020-01-01 12:00:00');
ss.info(startDateTimeholidayDateTime.getValuegetYearUTC()); // 2020-01-01 12:00:002019 |
subtract(first, second)
This method gets the duration between to SimpleDateTime values. Also, it can subtract the amount of time from the current SimpleDateTime object.
Parameter(s):
Name | Type | Mandatory | Default Value |
---|
first | SimpleDateTime Object | Y | N |
first | SimpleTime Object | Y | N |
first | Number (milliseconds) | Y | N |
second | SimpleDateTime Object | N | NULL |
second | SimpleTime Object | N | NULL |
second | Number (milliseconds) | N | NULL |
Return:
Type |
---|
SimpleDuration object |
Example:
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | subtract |
---|
linenumbers | true |
---|
|
const startDateTime = new SimpleDateTime("2019-01-01 08:00:00");
const periodTime = new SimpleTime();
periodTime.setValue("00:00:20");
startDateTime.subtract(periodTime);
const afterSutractDateTime = startDateTime.getTime();
ss.info(afterSutractDateTime.getByFormat('h:m:s')); // 01:12:40 |