# Creating a condition for a TIMER in a website

**URL:** <https://forums.distill.io/t/creating-a-condition-for-a-timer-in-a-website/3478>\
**Category:** Help and Support\
**Tags:** conditions\
**Created:** [May 20, 2024, 2:50pm UTC](https://forums.distill.io/t/creating-a-condition-for-a-timer-in-a-website/3478 "2024-05-20T14:50:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![poxtrek](https://forums.distill.io/letter_avatar_proxy/v4/letter/p/91b2a8/32.png) [@poxtrek](https://forums.distill.io/u/poxtrek)\
**Post date:** [May 20, 2024, 2:50pm UTC](https://forums.distill.io/t/creating-a-condition-for-a-timer-in-a-website/3478/1 "2024-05-20T14:50:50Z")

</div>

Hello There!

I have been trying to set a condition to activate whenever a timer inside a website goes above 02:00 (two minutes), however my condition doesn’t let me add time, i tried using regex to extract just the numbers from the website, and convert them to seconds only but that is not working either.

Has anyone done this before?

---

<div class="post-metadata">

**Author:** ![ajitk](https://forums.distill.io/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@ajitk](https://forums.distill.io/u/ajitk)\
**Post date:** [May 21, 2024, 3:53pm UTC](https://forums.distill.io/t/creating-a-condition-for-a-timer-in-a-website/3478/2 "2024-05-21T15:53:05Z")

</div>

@poxtrek conditions don’t have an understanding of time or time interval. if the time is displayed in `hh:mm` format, can using the following regex work?

`((0[2-9])|([1,2]\d)):\d\d`

following chatgpt’s explanation:

### Explanation

1. **Outer Parentheses `((0[2-9])|([1,2]\d))`**:  
This part groups the two main alternatives, making it easier to manage the overall structure and apply the `|` operator (logical OR).

2. **First Alternative `(0[2-9])`**:

3. **Second Alternative `([1,2]\d)`**:

4. **Colon `:`** :  
This matches the literal character ‘:’ separating hours and minutes in time notation.

5. **Minutes `\d\d`** :

### Putting It All Together

The regular expression `((0[2-9])|([1,2]\d)):\d\d` matches times formatted as “HH:MM” where:

- The hours (`HH`) can be:
  - From 02 to 09 (inclusive).
  - From 10 to 29 (inclusive).

- The minutes (`MM`) can be any two-digit number from 00 to 59.

### Examples

- `02:00` (matches because 02 is in the range 02-09 and 00 is valid minutes)
- `15:30` (matches because 15 is in the range 10-29 and 30 is valid minutes)
- `22:59` (matches because 22 is in the range 10-29 and 59 is valid minutes)
- `09:45` (matches because 09 is in the range 02-09 and 45 is valid minutes)

This regex is useful for validating time formats where hours can range from 02 to 29 and minutes can be any valid two-digit minute value.
