Shape · Dates and time

Make Date from Parts

Combines separate year, month and day columns (and hour, minute, second) into one real date or timestamp.

Also known as: Date from parts

How it works

Each build picks a kind (Date, Time or Timestamp), one source per part and an output column, which is required. A part is either a Column or a fixed Number. Date and Timestamp builds need Year, Month and Day; a build missing one of them is skipped. Hour, Minute and Second are optional and count as 0 when left out, so a Timestamp from year, month and day lands on midnight; Second may be fractional. The new column is appended and the source columns stay. Two builds with the same output name get a _2 suffix on the second.

Inputs and outputs

Inputs

  • data — Table

Outputs

  • data — Table

Settings

The Attributes panel of Make Date from Parts, as in the app: the controls work, but nothing runs — there is no data behind it.

The same settings, as the Assistant writes them
builds: [{kind:"date"|"time"|"timestamp", year/month/day/hour/minute/second:{partSource:"column"|"const", column?|const?}, outputColumn?}] — omitted clock parts default to 0; omit outputColumn to get the suggested name date / time / timestamp (the build's kind), with _2, _3… when that name is taken

Example

A sales export has yr, mo and dy as separate numbers. Add a build of kind Date with Year = yr, Month = mo, Day = dy and output sale_date. To stamp every row at the first of its month instead, set Day to the Number 1.

yrmodysale_date
20243152024-03-15
20231212023-12-01