NIFI-1078: Fixed typo in docs and added additional examples
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/8a9a44c1 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/8a9a44c1 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/8a9a44c1 Branch: refs/heads/master Commit: 8a9a44c102f6e60e826fa85115ce31084eab4f17 Parents: 23364f5 Author: Mark Payne <[email protected]> Authored: Thu Jan 28 09:35:05 2016 -0500 Committer: Mark Payne <[email protected]> Committed: Thu Jan 28 09:35:05 2016 -0500 ---------------------------------------------------------------------- .../main/asciidoc/expression-language-guide.adoc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/8a9a44c1/nifi-docs/src/main/asciidoc/expression-language-guide.adoc ---------------------------------------------------------------------- diff --git a/nifi-docs/src/main/asciidoc/expression-language-guide.adoc b/nifi-docs/src/main/asciidoc/expression-language-guide.adoc index e894a12..a78c559 100644 --- a/nifi-docs/src/main/asciidoc/expression-language-guide.adoc +++ b/nifi-docs/src/main/asciidoc/expression-language-guide.adoc @@ -1383,9 +1383,21 @@ chaining together the two functions: `${date:toDate('MM-dd-yyyy'):format('yyyy/M Date type representing that time. Since whole Expression Language expressions can only return Strings it would formatted as `Wed Dec 31 15:36:03 EST 2014` when the expression completes. -The utilizing the <<toNumber>> method, `now` can provide the current date and time as the number of milliseconds since +Utilizing the <<toNumber>> method, `now` can provide the current date and time as the number of milliseconds since Midnight GMT on January 1, 1970. For instance, if instead of executing `${now()}` in the previous example `${now():toNumber()}` -was run then it would output `1453843201123`. This way preserves the millisecond field. +was run then it would output `1453843201123`. This method provides millisecond-level precision and provides the ability to +manipulate the value. + +.now Examples +|================================================================================================================== +| Expression | Value +| `${now()}` | A Date type representing the current date and time to the nearest millisecond +| `${now():toNumber()}` | The number of milliseconds since midnight GMT Jan 1, 1970 (`1453843201123`, for example) +| `${now():toNumber():minus(86400000)` | A number presenting the time 24 hours ago +| `${now():format('yyyy')}` | The current year +| `${now():toNumber():minus(86400000):format('E')}` | The day of the week that was yesterday, + as a 3-letter abbreviation (For example, `Wed`) +|==================================================================================================================
