Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds
timeOffset
andtimeDiff
Expression functions, as well as change the Expression Function documentation to create aTime operations
section to group up these, and the previous time related functions.timeOffset
allows taking in a timestamp an offset, and optionally a 12 hour clock boolean, and outputting the time with that offset in the same format it came in with (eg, if hh:mm:ss is provided, then hh:mm:ss is returned, if seconds are omitted then likewise in the return value).timeDiff
compares 2 times, either inhh:mm:ss
style format, or a Date Time String, egYYYY-MM-DDTHH:mm:ss.sssZ
, with the return value in seconds. This allows for easy creation of countdowns, formatting of the seconds can easily be done with the existingmsToTimestamp
Expression Function, and because the return value is a number it also makes it easy to do things like triggers when the value is less than 30 seconds, or when it becomes negative to show when over-running etc....These sort of basic time functions should help with the growing use of Expression Funcitons and Triggers for more complex automation. I had considered an additional function that would allow a timezone instead of an offset, but with the frequent confusion around time zones due to DST (eg, people referring to EST instead of EDT, or GMT instead of BST) using a numerical or timestamp offset in
timeOffset
should be a more reliable option.