Strategy ONE
Define Date and Time Data Types When Wrangling Data
During the data wrangling process you can change a column's data type to display dates and times in an appropriate format. See Functions for Wrangling Data for more information about the various functions.
- Open the Preview dialog.
- Click the table drop-down.
- Click Wrangle.
- Select a column.
- Select the Change Data Type function.
- In the next drop-down, select Number, Date, or Text.
-
If you select Date, enter the applicable format in Input Date Format using the characters from the table below.
If your data displays 01022014 for January 2, 2014, enter a date format of MMddyyyy in Input Date Format. If your data displays 2014.01.02, enter a date format of yyyy.MM.dd. If your data displays Thu Jan 2, 14, enter a date format of EEE MMM d, yy.
- Click Apply.
All date format options in the table below are case-specific.
| Date Format | Description |
|
G |
Era designator, such as AD or BC |
|
y |
Year, such as 96 or 1996 |
|
M |
Month in year, such as 01, Jan, or January |
|
w |
Week number in year. The 27th week of the year appears as 27. |
|
W |
Week number in month. The second week of February appears as 2. |
|
D |
Day number in year. The 189th day of the year appears as 189. |
|
d |
Day number in month, such as 10 |
|
F |
Day of week in month, such as 2 |
|
E |
Day name, such as Sun or Sunday |
|
a |
AM or PM marker, to display time using a 12-hour clock |
|
H |
Hour, based on a 24-hour clock, from 0 to 23 |
|
k |
Hour, based on a 24-hour clock, from 1 to 24 |
|
K |
Hour in AM or PM, from 0 to 11 |
|
h |
Hour in AM or PM, from 1 to 12 |
|
m |
Minute |
|
s |
Second |
|
S |
Millisecond |
|
z |
Time zone, such as GMT-08:00, PST, or Pacific Standard Time |
|
Z |
Time zone using the RFC 822 four-digit time zone, such as -0800 |
