Date-Time
This function block provides the current date and time as a human-readable string. You can choose between several common formats and a filename-friendly variant for saving files.
π₯ Inputs
This function block does not have any inputs.
π€ Outputs
Text The current date and time as a string, formatted according to the selected options.
πΉοΈ Controls
Format Combobox to select output format. Typical choices include:
Standard (YYYY-MM-DD HH:MM:SS)
Milliseconds (YYYY-MM-DD HH:MM:SS.sss)
Iso Format (ISO 8601)
File Name Mode Combobox to select a filename-friendly style. Options include:
Standard (human-readable string)
File Name (replaces characters like ":" and spaces so the string can be used as a file or folder name)
π¨ Features
Multiple date/time formats for different needs (readable text, high-precision timestamps, or ISO standard).
Filename-safe option that transforms the date/time into a format suitable for file naming without additional processing.
Simple, no-input operation β returns the current system time on each evaluation.
π Usage Instructions
Choose the desired output style with the
Formatcontrol.If you plan to use the output as part of a filename (for saving images, logs, or videos), select the
File Name Modeto get a safe string.Connect the
Textoutput to downstream blocks that need time information (for naming files, logging, or annotations).
π Evaluation
Each run, this function block reads the system clock and outputs a string formatted according to the chosen Format and File Name Mode settings.
π‘ Tips and Tricks
Use the block together with
Image WriteorImage Loggerto save images with a timestamped filename. SelectingFile Namemode will avoid illegal filename characters automatically.Combine with
Record Videowhen creating time-stamped recordings to organize files by run time.Pair with
CSV ExportorData to JSONto add a readable timestamp to exported data rows or logs.If you need separate date/time components (year, month, hour, etc.) for conditional logic or display, consider using
Date-Time Listwhere available to get structured elements instead of a single string.Use
String Mergeto combine the timestamp with other text (for example, camera ID or experiment name) before writing files withFile/Folder OperationsorChoose Folder.
π οΈ Troubleshooting
If filenames created using the timestamp cause errors on save, switch the
File Name ModetoFile Nameto remove or replace characters that are not permitted in filenames.If you need higher precision for short-duration events, select the
Millisecondsformat.If downstream blocks expect a specific timestamp format, verify the chosen
Formatmatches that expectation and adjust accordingly.
Last updated
Was this helpful?