Built-in JS Functions Overview¶
EnOS provides built-in JavaScript functions that you can use in the Script node to convert the input msg into your desired format. The functions are grouped according to their usage.
Time¶
Use Time functions to add days/time to a specific date.
Function |
Description |
---|---|
Add days to a specific date/time |
|
Add hours to a specific date/time |
|
Add minutes to a specific date/time |
|
Add seconds to a specific date/time |
Date¶
Date functions generate and format date values.
Function |
Description |
---|---|
Calculates the time difference between two dates and returns the difference in 4 different time units: seconds, minutes, hours, and days. |
|
Compares two dates and returns the result as an integer. |
|
Builds a date String based on the specified pattern and date units. |
|
Builds a date/time String based on the specified pattern and date/time units. |
|
Converts a date/time (String) from one format to another. |
|
Returns the current date as a String in the specified format. |
|
Increments a date/time by the specified date/time units. |
Utils¶
Utils functions provides utility services.
Function |
Description |
---|---|
Generates a random Universally Unique Identifier (UUID). |