Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version r0821

D toc

Excerpt

Derives the value for the current date 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.

For more information on generating the date and time stamp value for the current time, see NOW Function.

D s lang vs sql

D s
snippetBasic

Basic Example:

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:today() as:'nowTime'

today()

Output: Returns the Datetime value for the current date in UTC time zone.

Example with Time Zone:

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:today('America/New York') as:'nowTime'

today('America/New York')

Output: Returns the Datetime value for the current date based on the time in the Eastern U.S. time zone.

D s
snippetSyntax

D lang syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:today([str_timezone])

today([str_timezone])


ArgumentRequired?Data TypeDescription
str_timezoneNstringString value for the time zone for which the date value is calculated.

D s lang notes

str_timezone

String value for the time zone to use.

For a list of supported values for time zones, see Supported Time Zone Values.

D s
snippetusage

Required?Data TypeExample Value
NoString'America/New York'

D s
snippetExamples

Example - Flight Status report

Include Page
EXAMPLE - NOW and TODAY Functions
EXAMPLE - NOW and TODAY Functions

D s also
labeldate