Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Example - Other date formatting variations

...

Numeric date, year first

SourceTransformResults

2/15/16 13:26:58.123

3/12/99 2:45:21.456

11/21/11 23:02:18.000


D code

derive type:single value:DATEFORMAT(Timestamp,'yyyy-MM-dd') as:'newTimestamp'


2016-02-15

1999-03-12

2011-11-21

Numeric date, American style

SourceTransformResults

2/15/16 13:26:58.123

3/12/99 2:45:21.456

11/21/11 23:02:18.000


D code

derive type:single value:DATEFORMAT(Timestamp,'M/d/yy') as:'newTimestamp'


2/15/16

3/12/99

11/21/11

Full written date

SourceTransformResults

2/15/16 13:26:58.123

3/12/99 2:45:21.456

11/21/11 23:02:18.000


D code

derive type:single value:DATEFORMAT(Timestamp,'MMMM dd, yyyy') as:'newTimestamp'


February 15, 2016

March 12, 1999

November 21, 2011

Abbreviated date,

...

 including abbreviated day of week

SourceTransformResults

2/15/16 13:26:58.123

3/12/99 2:45:21.456

11/21/11 23:02:18.000


D code

derive type:single value:DATEFORMAT(Timestamp,'EEE MMM dd, yyyy') as:'newTimestamp'


Mon Feb 15, 2016

Fri Mar 12, 1999

Mon Nov 21, 2011

Full 24-hour time

SourceTransformResults

2/15/16 13:26:58.123

3/12/99 2:45:21.456

11/21/11 23:02:18.000


D code

derive type:single value:DATEFORMAT(Timestamp,'HH:mm:ss.SSS') as:'newTimestamp'


13:26:58.123

2:45:21.456

23:02:18.000

Twelve-hour time with AM/PM indicator


SourceTransformResults

2/15/16 13:26:58.123

3/12/99 2:45:21.456

11/21/11 23:02:18.000


D code

derive type:single value:DATEFORMAT(Timestamp,'h:mm:ss a') as:'newTimestamp'


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

For more information on supported date formats, see Datetime Data Type.

...