# Set Custom Time

You can use the `setTime()` method in expressions to manipulate the **time portion** of a `DateTime` object while keeping the **date unchanged**. This is useful when you need to compare datetimes, align time boundaries (e.g., end of day), or create consistent evaluation logic in rules.

***

#### 📌 Syntax

```plaintext
(datetime).setTime(hour, minute, second)
```

* `datetime` – a valid DateTime object (e.g. `event.eventDate`, `member.createdAt`, `executionContext.processedAt` etc.)
* `hour` – an integer between 0 and 23
* `minute` – an integer between 0 and 59
* `second` – an integer between 0 and 59

***

#### ✅ Example Use Case

**Set the point expiry on the same day as when the transaction was placed**

```plaintext
(transaction.purchasedAt).setTime(23, 59, 59)
```

You can create a dynamic configuration for the expiration or pending periods in your campaigns:

<figure><img src="https://2658975168-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcNVX03KZzmrGwJihLiEx%2Fuploads%2FkQMkHffK8C5JM9bHKZzU%2Fimage.png?alt=media&#x26;token=a1e423e7-1422-4337-9bf2-b82b7fbabb63" alt=""><figcaption></figcaption></figure>

***

#### 🧪 Tip

You can combine it with helper methods like `add_days_to_date`, `add_months_to_date`, or `add_years_to_date` to build more dynamic expressions.
