# 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 <a href="#inputs" id="inputs"></a>

This function block does not have any inputs.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`Text` The current date and time as a string, formatted according to the selected options.

## 🕹️ Controls <a href="#controls" id="controls"></a>

`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 <a href="#features" id="features"></a>

* 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 <a href="#usage" id="usage"></a>

1. Choose the desired output style with the `Format` control.
2. If you plan to use the output as part of a filename (for saving images, logs, or videos), select the `File Name Mode` to get a safe string.
3. Connect the `Text` output to downstream blocks that need time information (for naming files, logging, or annotations).

## 📊 Evaluation <a href="#evaluation" id="evaluation"></a>

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 <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* Use the block together with `Image Write` or `Image Logger` to save images with a timestamped filename. Selecting `File Name` mode will avoid illegal filename characters automatically.
* Combine with `Record Video` when creating time-stamped recordings to organize files by run time.
* Pair with `CSV Export` or `Data to JSON` to 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 List` where available to get structured elements instead of a single string.
* Use `String Merge` to combine the timestamp with other text (for example, camera ID or experiment name) before writing files with `File/Folder Operations` or `Choose Folder`.

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* If filenames created using the timestamp cause errors on save, switch the `File Name Mode` to `File Name` to remove or replace characters that are not permitted in filenames.
* If you need higher precision for short-duration events, select the `Milliseconds` format.
* If downstream blocks expect a specific timestamp format, verify the chosen `Format` matches that expectation and adjust accordingly.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augelab.com/function-blocks/input-output/data-inputs/date-time.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
