DateTime
Convert text or numeric dates into dates or timestamps you can sort, filter and compare. Set the format yourself when day and month could be confused.
Parse dates
Manual Input has four rows with id and date_text columns. DateTime reads date_text as day/month/year and adds a DATE column named parsed_datetime.
DateTime interactive example
Loading interactive example…
The live example needs a desktop screen. The result it produces is shown here, and the explanation and settings below work on any screen.
| id | date_text | parsed_datetime |
|---|---|---|
| 1 | 15/07/2026 | 2026-07-15 |
| 2 | 02/08/2026 | 2026-08-02 |
| 3 | pending | |
| 4 |
- Change Output as to
TIMESTAMP. The two valid dates now include a time of midnight. - Change Output column to
date_text. The parsed values replace the original text instead of adding a column. - Change If parse fails to
Fail. The valuependingcauses an error.
When to use
Use DateTime when dates are stored as text or numbers and you need to sort, filter or compare them. Set the format yourself when day and month could be confused.
Read the output
The output keeps id and date_text and adds parsed_datetime. 15/07/2026 becomes 2026-07-15, and 02/08/2026 becomes 2026-08-02. Both are DATE values. The text pending and the missing value produce NULL. All four rows stay.
Choose the input format based on the source: 02/08/2026 means August 2 in EU date format but February 8 in US date format. A value can parse without an error and still be the wrong date.
With ISO selected, the first result is 2026-07-15T00:00:00.
To generate the current date or time, use Date/Time Now.
To infer column types automatically, use Auto Field.
Inputs and outputs
Inputs
1 port- InRequired
Accepts: Tables, Geospatial data.
Accepts one connection on this port.
Outputs
1 port- Out
Configure the block
Choose the source format, the output type and what should happen when a value can't be parsed.
- Column
Choose the text or numeric column to parse. The first eligible column is selected automatically.
- Text looks like
Choose the source format: EU date reads day/month/year, and US date reads month/day/year. Choose UNIX ms for milliseconds since the Unix epoch, or Custom for another layout.
- Pattern
Shown for Custom. Enter a strptime pattern: %d/%m/%Y reads day/month/four-digit year.
- Output as
Choose how parsed values are represented. UNIX: Milliseconds since the Unix epoch, stored as text. ISO: Date and time text formatted to seconds, without fractional seconds or a timezone suffix. DATE: A typed date without a time of day. TIME: A time of day in UTC, without a date. TIMESTAMP: A typed date and time. Date-only inputs use midnight. TIMESTAMP WITH TIME ZONE: Dates with times, stored in UTC. Default: TIMESTAMP.
- Output column
Name the result column. Use the source column's name to replace it. Default: parsed_datetime.
- If parse fails
Null leaves an unparseable value missing while keeping its row. Fail reports an error instead. Default: Null.
DateTime FAQs
- Does parsing remove rows?
- No. With Null selected, invalid values become NULL and all rows stay. Fail stops the block when a value can't be parsed.
- What happens to missing values?
- NULL input values stay NULL, including when If parse fails is set to Fail.
- Can the ISO preset read any ISO timestamp?
- The preset expects a layout such as 2026-07-15T15:14:06, with optional fractional seconds and a Z or numeric offset such as +02:00. Offsets are converted to UTC. For named time zones, choose a matching Custom pattern.
Prepare your data. Build it in Strata.
Strata opens in your browser, with no account.