---
title: "How to validate a date?"
url: "https://openforis.support/questions/1243/how-to-validate-a-date"
tags: ["collect"]
status: "answered"
score: 0
answer_count: 2
asked: "2017-05-04T19:57:54"
last_activity: "2017-05-05T15:39:54"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# How to validate a date?

Asked by flandsberg on 2017-05-04

Hi!

I want to ensure that the date entered in a "date" is between 01 January 2010 and 31 December 2010.

I added a validation rule that reads: $this >='01/01/2010' and $this <= '12/31/2010' but I always get an error message whether I am in 2010 or not.

Any idea of what I need to change?

Many thanks,

Florence


## Answer (score 0, by Stefano (OF) on 2017-05-05)

Link: https://openforis.support/questions/1243/how-to-validate-a-date/1248

Hi Florence,  
The format for the date is this: 'yyyyMMdd'  
E.g. **'20170505'**.

Thanks,  
Open Foris Team


## Answer (score 0, by flandsberg on 2017-05-05)

Link: https://openforis.support/questions/1243/how-to-validate-a-date/1251

Many thanks Open Foris team, for the answer and your super responsiveness!! 

Florence
