All templates
Date & TimeBeginner
Convert Text to Datetime
Robomotion•Updated 6 months ago

Overview
Parses a text string like "2025-05-01 09:30:00" into a true datetime value the flow can work with. Shows how to declare an input layout so downstream nodes can format or compare the date.
Convert Text to Datetime
Although flows can extract data from documents, the retrieved values are usually stored as text. If a text represents a date or time value, Robomotion enables users to convert it to a datetime variable and use this variable for further date and time calculations.
What Convert Text to Datetime can do
- Parse date (
Robomotion.DateTime.Format) —inTime: 20220101, custom input layout20060102, outputRFC3339→msg.text_as_date_time. - Build text (
Core.Programming.Function) →msg.dialog_text = "The text '20220101' has been converted to the following datetime variable: " + msg.text_as_date_time, thenCore.Dialog.MessageBoxtitledResult(info). - Parse time (
Robomotion.DateTime.Format) —inTime: 23:45:00, custom input layout15:04:05, outputRFC3339→msg.text_as_date_time, followed by the same build-text +Resultdialog pattern. - Parse datetime (
Robomotion.DateTime.Format) —inTime: January 01, 2022 23:45:00, custom input layoutJanuary 02, 2006 15:04:05, outputRFC3339→msg.text_as_date_time, followed by the finalResultdialog beforeCore.Flow.Stop.
Behind the scenes
Robomotion.DateTime.Formatuses Go-style reference-time layouts (2006,01,02,15,04,05) rather thanyyyy/MM/ddtokens — the literal sample values in the input layout are what define each field.msg.text_as_date_timeis deliberately reused across all three conversions — each dialog shows the value produced by the most recentParsestep.