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 r093

...

  • If the source Datetime value does not include a valid input for this function, a missing value is returned.
  • D s product
    rtrue
    supports a wide variety of formats for Datetime fields. For more information on supported date formats, see Datetime Data Type. 
  • You can explore the available Datetime formats through the Transformer page. From a column's type drop-down, select Date/Time . Then, select the formatting category. From the displayed drop-down, you can select a specific format. When this transform step is added to your recipe, you can edit it to see how the format is specified in
    D s lang
    .

...

  • Missing values for this function in the source data result in missing values in the output.
  • Multiple columns and wildcards are not supported.

D s
snippetusage

 

Required?Data TypeExample Value
YesDatetimemyDate

...

Info

NOTE: If the platform cannot recognize the date format string, the generated result is written as a string value.

...

.

  • Missing values for this function in the source data result in missing values in the output.
  • Multiple columns and wildcards are not supported.

...

Example - Other date formatting variations

Numeric date, year first

SourceTransformationResults

2/15/16 13:26:58.123

3/12/99 2:45:21.456

11/21/11 23:02:18.000

D trans
RawWrangletrue
p03Value'newTimestamp'
Typestep
WrangleTextderive type:single value:dateformat(Timestamp,'yyyy-MM-dd') as:'newTimestamp'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valuedateformat(Timestamp,'yyyy-MM-dd')
p03NameNew column name
SearchTermNew formula

2016-02-15

1999-03-12

2011-11-21

Numeric date, American style

SourceTransformationResults

2/15/16 13:26:58.123

3/12/99 2:45:21.456

11/21/11 23:02:18.000

D trans
RawWrangletrue
p03Value'newTimestamp'
Typestep
WrangleTextderive type:single value:dateformat(Timestamp,'M/d/yy') as:'newTimestamp'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valuedateformat(Timestamp,'M/d/yy')
p03NameNew column name
SearchTermNew formula

2/15/16

3/12/99

11/21/11

Full written date

SourceTransformationResults

2/15/16 13:26:58.123

3/12/99 2:45:21.456

11/21/11 23:02:18.000

D trans
RawWrangletrue
p03Value'newTimestamp'
Typestep
WrangleTextderive type:single value:dateformat(Timestamp,'MMMM dd, yyyy') as:'newTimestamp'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valuedateformat(Timestamp,'MMMM dd, yyyy')
p03NameNew column name
SearchTermNew formula

February 15, 2016

March 12, 1999

November 21, 2011

Abbreviated date, including abbreviated day of week

SourceTransformationResults

2/15/16 13:26:58.123

3/12/99 2:45:21.456

11/21/11 23:02:18.000

D trans
RawWrangletrue
p03Value'newTimestamp'
Typestep
WrangleTextderive type:single value:dateformat(Timestamp,'EEE MMM dd, yyyy') as:'newTimestamp'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valuedateformat(Timestamp,'EEE MMM dd, yyyy')
p03NameNew column name
SearchTermNew formula

Mon Feb 15, 2016

Fri Mar 12, 1999

Mon Nov 21, 2011

Full 24-hour time

SourceTransformationResults

2/15/16 13:26:58.123

3/12/99 2:45:21.456

11/21/11 23:02:18.000

D trans
RawWrangletrue
p03Value'newTimestamp'
Typestep
WrangleTextderive type:single value:dateformat(Timestamp,'HH:mm:ss.SSS') as:'newTimestamp'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valuedateformat(Timestamp,'HH:mm:ss.SSS')
p03NameNew column name
SearchTermNew formula

13:26:58.123

2:45:21.456

23:02:18.000

Twelve-hour time with AM/PM indicator

...

SourceTransformationResults

2/15/16 13:26:58.123

3/12/99 2:45:21.456

11/21/11 23:02:18.000

D trans
RawWrangletrue
p03Value'newTimestamp'
Typestep
WrangleTextderive type:single value:dateformat(Timestamp,'h:mm:ss a') as:'newTimestamp'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valuedateformat(Timestamp,'h:mm:ss a')
p03NameNew column name
SearchTermNew formula

Info

NOTE: For this function, use of the lower-case hour indicator (h or hh) requires the use of an AM/PM indicator (a).

 

 

1:26:58 PM

2:45:21 AM

11:02:18 PM

...

D s also
labeldate