CastToTemporal / Manipulation Layer

Convert string columns to temporal (Date, Time, or DateTime) types. Similar to pandas' to_datetime(), to_time(), or Rust's chrono::{NaiveDate, NaiveTime, DateTime}::parse_from_str().

Example conversions:

Input StringFormat PatternTypeResult
2024-01-31%Y-%m-%dDate2024-01-31
15:30:45.123%H:%M:%S.%fTime15:30:45.123
2024-01-31T15:30:45Z%Y-%m-%dT%H:%M:%SZDateTime2024-01-31 15:30:45 UTC
Jan 31, 2024 at 3:30PM EST%b %d, %Y at %I:%M%p %ZDateTime2024-01-31 15:30:00 -0500
31/01/2024%d/%m/%YDate2024-01-31
01/31/2024%m/%d/%YDate2024-01-31
20240131%Y%m%dDate2024-01-31
03:30:45 PM%I:%M:%S %pTime15:30:45
Wed, 31 Jan 2024 15:30:45 +0000%a, %d %b %Y %H:%M:%S %zDateTime2024-01-31 15:30:45 UTC
1706713845%sDateTime2024-01-31 15:30:45 UTC

Real-world examples by industry:

Financial Industry:

  • Transaction logs: '2024-01-31 15:30:45.123 GMT' → '%Y-%m-%d %H:%M:%S.%f %Z'
  • Trading timestamps: '20240131-153045.123' → '%Y%m%d-%H%M%S.%f'
  • Banking records: '31-JAN-24' → '%d-%b-%y' (Oracle DB format)

Healthcare:

  • Patient records: '01/31/2024 @ 1530' → '%m/%d/%Y @ %H%M'
  • Medical device logs: '2024-01-31T15:30:45.123+00:00' → '%Y-%m-%dT%H:%M:%S.%f%:z'
  • Shift scheduling: '15:30 - 23:45' → '%H:%M' (for start time)

IT & Software:

  • Server logs: '[31/Jan/2024:15:30:45 +0000]' → '[%d/%b/%Y:%H:%M:%S %z]'
  • Application events: '1706713845123' (ms timestamp) → Parse as number ÷ 1000
  • Database timestamps: '2024-01-31 15:30:45.123456' → '%Y-%m-%d %H:%M:%S.%f'

Manufacturing & Logistics:

  • Production logs: 'WK04-2024 15:30:45' → 'WK%V-%Y %H:%M:%S'
  • Shipping records: '31JAN24' → '%d%b%y'
  • Sensor readings: '20240131153045' → '%Y%m%d%H%M%S'

Science & Research:

  • Lab notes: '31-Jan-2024 at 15h30m45s' → '%d-%b-%Y at %Hh%Mm%Ss'
  • Astronomical data: '2024-031T15:30:45.123Z' → '%Y-%jT%H:%M:%S.%fZ' (day of year)
  • Environmental monitoring: '1530:45 01/31/2024' → '%H%M:%S %m/%d/%Y'

Key features:

  • Multiple temporal type support (Date, Time, DateTime)
  • Flexible format parsing with strftime syntax
  • Configurable time zone handling
  • Adjustable precision levels (milliseconds to nanoseconds)

Common applications:

  • Log file timestamp parsing and standardization
  • Event data normalization for cross-platform analysis
  • Time series analysis preparation
  • Schedule and calendar data processing
  • Historical records analysis
  • Cross-timezone data reconciliation
  • Temporal data validation and cleaning

Format specifiers compatible with Rust's chrono library:

Date specifiers:

  • %Y - Full year (2024)
  • %y - Year, last two digits (24)
  • %C - Century (20)
  • %m - Month, zero-padded (01-12)
  • %b or %h - Abbreviated month name (Jan)
  • %B - Full month name (January)
  • %d - Day of month, zero-padded (01-31)
  • %e - Day of month, space-padded ( 1-31)
  • %j - Day of year, zero-padded (001-366)

Time specifiers:

  • %H - Hour (00-23), zero-padded
  • %I - Hour in 12-hour clock (01-12), zero-padded
  • %p - AM/PM (uppercase)
  • %P - am/pm (lowercase)
  • %M - Minute (00-59), zero-padded
  • %S - Second (00-60), zero-padded
  • %f - Nanoseconds
  • %.f - Decimal fraction of a second with leading dot

Timezone specifiers:

  • %z - Timezone offset (+0000)
  • %:z - Timezone offset with colon (+00:00)
  • %Z - Timezone name or abbreviation

See StringToDate, StringToTime, and StringToDateTime for more detailed format options.

Table
0
0
Table

Select

column

String column containing temporal data to convert. Must contain text that can be parsed into the specified temporal type using the given format.

Format

string

Format string using chrono-compatible strftime syntax. Common patterns:

For Date conversion:

  • %Y-%m-%d - ISO 8601 date (2024-01-31)
  • %d/%m/%Y - UK/European date (31/01/2024)
  • %m/%d/%Y - US date (01/31/2024)
  • %b %d, %Y - Written date (Jan 31, 2024)

For Time conversion:

  • %H:%M:%S - 24-hour time (15:30:45)
  • %I:%M:%S %p - 12-hour time (03:30:45 PM)
  • %H:%M:%S.%f - Time with fractional seconds (15:30:45.123)

For DateTime conversion:

  • %Y-%m-%d %H:%M:%S - ISO format (2024-01-31 15:30:45)
  • %Y-%m-%dT%H:%M:%S%z - ISO 8601 with timezone (2024-01-31T15:30:45+0000)
  • %a, %d %b %Y %H:%M:%S %z - RFC 2822 (Wed, 31 Jan 2024 15:30:45 +0000)

If not provided, attempts to infer format from data.

Date

Target temporal type for conversion. Choose based on the time components needed for your analysis.

Date ~

Calendar date without time (e.g., 2024-01-31). Maps to Rust's chrono::NaiveDate. Ideal for:

  • Birthday records and anniversary tracking
  • Schedule planning and calendar applications
  • Financial reporting dates (quarterly, yearly)
  • Academic terms and course scheduling
Time ~

Time of day without date (e.g., 15:30:45). Maps to Rust's chrono::NaiveTime. Suitable for:

  • Daily schedules and recurring events
  • Business operating hours
  • Transportation timetables
  • Performance timing measurements
  • Shift scheduling and time tracking
DateTime ~

Complete date and time with optional timezone (e.g., 2024-01-31 15:30:45). Maps to Rust's chrono::DateTime. Used for:

  • Event logs and audit trails
  • Transaction timestamps
  • System monitoring and diagnostics
  • Time series data analysis
  • IoT sensor readings
  • International meeting scheduling
None

Precision level for time storage, matching chrono's precision options.

None ~

Automatically determine precision from input format. Best for general use when precision requirements are flexible.

Milliseconds ~

Millisecond precision (10^-3 seconds, 3 decimal places). Equivalent to chrono's TimeUnit::MILLI. Suitable for:

  • Web application logging
  • User interaction timing
  • Most business applications
  • Financial transaction timestamping
Microseconds ~

Microsecond precision (10^-6 seconds, 6 decimal places). Equivalent to chrono's TimeUnit::MICRO. Used in:

  • Scientific measurements
  • High-frequency trading
  • Detailed performance profiling
  • Audio processing timestamps
Nanoseconds ~

Nanosecond precision (10^-9 seconds, 9 decimal places). Equivalent to chrono's TimeUnit::NANO. For:

  • Scientific instruments
  • Precise system timing
  • Hardware measurements
  • High-precision simulations

TimeZone

string

Target time zone for DateTime values using IANA timezone database names (e.g., 'UTC', 'America/New_York', 'Europe/London'). Similar to chrono-tz functionality. Critical for:

  • Global data analysis across regions
  • Cross-region operations and reporting
  • Daylight saving time handling
  • Historical timestamp corrections Empty value means keep original timezone or use local timezone if none specified.

Strict

bool
false

Controls error handling:

  • true: Fail if any value can't be converted (similar to chrono's strict parsing)
  • false: Replace invalid values with null Use true for data validation, false for flexible processing.

Exact

bool
true

Controls format matching:

  • true: Require exact format match (like chrono's parse_from_str)
  • false: Allow format to match within larger strings Example: with format '%Y-%m-%d', process 'Date: 2024-01-31' when false.

Name for the new column. If not provided, the system generates a unique name. If AsColumn matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.