Excerpt |
---|
Derives the timestamp for the current time in UTC time zone. You can specify a different time zone by optional parameter.
|
For this function, the values that you see in the Transformer grid are generated during the preview. These values will differ from the values that are generated later, when the job is executed.
Info |
---|
NOTE: Some Datetime functions do not allow the nesting of NOW and TODAY functions. You should create a separate column containing these values. |
Other differences:
- If you refresh the page for the Transformer grid, the function is recalculated.
- If you re-open the dataset in the Transformer page, the function is recalculated.
- If you have multiple versions of the function in the same dataset, you are likely to end up with different generated timestamps. The difference in their values cannot be accurately predicted.
Tip |
---|
Tip: If you wish to use the same computed value for this function across your dataset, you should generate a column containing values for the function and then base all of your other calculations off of these column values. |
Info |
---|
NOTE: If no time zone is specified, the default is UTC time zone. Time values are returned in 24-hour time. |
For more information on generating the date value only for today, see TODAY Function.
Basic Example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value:now() as:'nowTime' |
---|
|
now() |
Output: Returns the current timestamp in UTC time zone.
Example with Time Zone:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value:now('America/New York') as:'nowTime' |
---|
|
now('America/New York') |
Output: Returns the current timestamp based on the time in the Eastern U.S. time zone.
D lang syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | derive type:single value:now(str_timezone) |
---|
|
now(str_timezone) |
Argument | Required? | Data Type | Description |
---|
str_timezone | N | string | String value for the time zone for which the timestamp is calculated. |
str_timezone
String value for the time zone to use.
Required? | Data Type | Example Value |
---|
No | String | 'America/New York' |
Example - Flight Status report
Include Page |
---|
| EXAMPLE - NOW and TODAY Functions |
---|
| EXAMPLE - NOW and TODAY Functions |
---|
|