# InsertWallclock

{% hint style="success" %}
Use [InsertWallclockHeaders ](/latest/connectors/single-message-transforms/insertwallclockheaders.md)SMT if you want to use more than one date time part. This avoids multiple SMTs and is more efficient.&#x20;

For example, if you want to partition the data by **`yyyy-MM-dd/HH`**, then you can use **`InsertWallclockHeaders`** which inserts multiple headers: date, year, month, day, hour, minute, second.
{% endhint %}

Inserts the system clock as a message header, with a value of type STRING. The value can be either a string representation of the date and time epoch value, or a string representation of the date and time in the format specified for example `yyyy-MM-dd HH:mm:ss.SSS`.

## Transform Type Class

```properties
io.lenses.connect.smt.header.InsertWallclock
```

## Configuration

<table data-full-width="false"><thead><tr><th width="162">Name</th><th width="184">Description</th><th width="86">Type</th><th width="85">Default</th><th width="123">Valid Values</th><th>Importance</th></tr></thead><tbody><tr><td><code>header.name</code></td><td>The name of the header to insert the timestamp into.</td><td>String</td><td></td><td></td><td>High</td></tr><tr><td><code>value.type</code></td><td>Sets the header value inserted. It can be epoch or string. If string is used, then the 'format' setting is required."</td><td>String</td><td>format</td><td>epoch,format</td><td>High</td></tr><tr><td><code>format</code></td><td>Sets the format of the header value inserted if the type was set to string. It can be any valid java date format.</td><td>String</td><td></td><td></td><td>High</td></tr><tr><td><code>timezone</code></td><td>Sets the timezone. It can be any valid java timezone. Overwrite it when <code>value.type</code> is set to <code>format</code>, otherwise it will raise an exception.</td><td>String</td><td>UTC</td><td></td><td>High</td></tr></tbody></table>

## Example

To store the epoch value, use the following configuration:

```properties
transforms=InsertWallclock
transforms.InsertWallclock.type=io.lenses.connect.smt.header.InsertWallclock
transforms.InsertWallclock.header.name=wallclock
transforms.InsertWallclock.value.type=epoch
```

To store a string representation of the date and time in the format `yyyy-MM-dd HH:mm:ss.SSS`, use the following:

```properties
transforms=InsertWallclock
transforms.InsertWallclock.type=io.lenses.connect.smt.header.InsertWallclock
transforms.InsertWallclock.header.name=wallclock
transforms.InsertWallclock.value.type=format
transforms.InsertWallclock.format=yyyy-MM-dd HH:mm:ss.SSS
```

To use the timezone `Asia/Kolkoata`, use the following:

```properties
transforms=InsertWallclock
transforms.InsertWallclock.type=io.lenses.connect.smt.header.InsertWallclock
transforms.InsertWallclock.header.name=wallclock
transforms.InsertWallclock.value.type=format
transforms.InsertWallclock.format=yyyy-MM-dd HH:mm:ss.SSS
transforms.InsertWallclock.timezone=Asia/Kolkata
```


---

# 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.lenses.io/latest/connectors/single-message-transforms/insertwallclock.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.
