@TextToTime (Formula Language)

Converts a text string to a time-date value, where possible.

Syntax

@TextToTime( string )

Parameters

string

Text or text list. The string you want to convert to a time-date.

Return value

time-date

Time-date, time-date range, or list thereof. The string, converted to a time-date.

Usage

If the parameter is a list, the function operates on each element of the list, and the return value is a list with the same number of elements.

This function is useful for converting a date within a text field to a value that can be used for computation in a time-date field.

"Today", "Tomorrow", and "Yesterday" are the only legal strings to use to represent relative dates. The formula @TextToTime("Next week") returns a blank because the text string "Next week" cannot be converted to a time-date value.

@TextToTime returns an error If you try to pass anything besides a string into it, including a time-date value.

Examples

  1. This example returns 12-31-2025.
    @TextToTime("12-31-2025")
  2. This example returns 12-31-2025, if today is December 31, 2025.
    @TextToTime("Today")
  3. This example returns 01-01-2026, if tomorrow is January 1, 2026.
    @TextToTime("Tomorrow")
  4. This example returns 12-30-2025, if yesterday was December 30, 2025.
    @TextToTime("Yesterday")