# Check if value is date

**URL:** <https://community.make.com/t/check-if-value-is-date/71275>\
**Category:** Questions\
**Tags:** format-date, date-time-functions\
**Created:** [February 24, 2025, 1:12pm UTC](https://community.make.com/t/check-if-value-is-date/71275 "2025-02-24T13:12:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [February 24, 2025, 3:37pm UTC](https://community.make.com/t/check-if-value-is-date/71275/2 "2025-02-24T15:37:23Z")

</div>

Welcome to the Make community!

You can use the built-in functions `if` `length` `replace` with a regular expression to check the format.

e.g.:

```plaintext
{{if(length(replace(1.string; "/^\d{2}-\d{2}-\d{4}$/"; emptystring)) = 0; true; false)}}

```

**Output:**

 ![Screenshot_2025-02-24_230212](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/7/5/75b08b9a6cd9e6148f7138bd6b9afa83dc4db3a4.png)

For more information, see the function documentation in the [Help Center](https://www.make.com/en/help) and do the [tutorials in the Make Academy](https://academy.make.com).

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

P.S.: Investing some effort into the [Make Academy](https://academy.make.com) will save you lots of time and frustration using Make.

## Module Export - quick import into your scenario

 ![Screenshot_2025-02-24_230257](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/2/52d728c9dac181e9101d2161d1dd5ea3581f1ad4.png)

You can **copy** and **paste** this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.

1. Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the **right** of the code, which looks like this:  
 ![](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/c/8/c84e1e230dccfa07b6d6d27e2c0fecf7dc7a5c32.png)

2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.

3. Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.

**JSON module export** — paste this directly in your scenario

```json
{"subflows":[{"flow":[{"id":269,"module":"util:SetVariables","version":1,"parameters":{},"mapper":{"variables":[{"name":"date1","value":"abcdef"},{"name":"date2","value":"31-01-2025"}],"scope":"roundtrip"},"metadata":{"designer":{"x":356,"y":-1441}}},{"id":268,"module":"util:SetVariables","version":1,"parameters":{},"mapper":{"variables":[{"name":"date1","value":"{{269.date1}}"},{"name":"isValidFormat","value":"{{if(length(replace(269.date1; \"/^\\d{2}-\\d{2}-\\d{4}$/\"; emptystring)) = 0; true; false)}}"},{"name":"date2","value":"{{269.date2}}"},{"name":"isValidFormat2","value":"{{if(length(replace(269.date2; \"/^\\d{2}-\\d{2}-\\d{4}$/\"; emptystring)) = 0; true; false)}}"}],"scope":"roundtrip"},"metadata":{"designer":{"x":602,"y":-1441}}}]}],"metadata":{"version":1}}

```

_Note: Did you know you can reduce the size of blueprints and module export code like the above, using the [Make Blueprint Scrubber](https://community.make.com/t/free-tool-reduce-blueprint-module-export-by-removing-extra-details/50697)?_

---

_[View the full topic](https://community.make.com/t/check-if-value-is-date/71275)._
