Check if it is a logical date.
 

1 date.isValid

<date.isValid>
    <m /> *
    <d /> *
    <y /> *
</date.isValid>
Example

Validate a date.

Copy
<xsql-script name='sample_date_isValid'>

    <body>
        <set name='m_dateYYYYMMDD_ko' type='string' >20090432</set>

        <set name='m_day'><string.substring><m_dateYYYYMMDD_ko /><number>6</number></string.substring></set>
        <set name='m_month'><string.substring><m_dateYYYYMMDD_ko /><number>4</number><number>6</number></string.substring></set>
        <set name='m_year'><string.substring><m_dateYYYYMMDD_ko /><number>0</number><number>4</number></string.substring></set>

        <println>
          Format date YYYYMMDD [<m_dateYYYYMMDD_ko />] is valid = [<date.isValid ><m_month /><m_day /><m_year /></date.isValid>]
        </println>

        <set name='m_dateYYYYMMDD_ok' type='string' >20090430</set>

        <set name='m_day'><string.substring><m_dateYYYYMMDD_ok /><number>6</number></string.substring></set>
        <set name='m_month'><string.substring><m_dateYYYYMMDD_ok /><number>4</number><number>6</number></string.substring></set>
        <set name='m_year'><string.substring><m_dateYYYYMMDD_ok /><number>0</number><number>4</number></string.substring></set>

        <println>
          Format date YYYYMMDD [<m_dateYYYYMMDD_ok />] is valid = [<date.isValid ><m_month /><m_day /><m_year /></date.isValid>]
        </println>

    </body>
</xsql-script>

Devuelve:

Copy
Format date YYYYMMDD [20090432] is valid = [false]
Format date YYYYMMDD [20090430] is valid = [true]

Notas

Incorrect dates for impossibles or ilogicals, would be those that include as Month values less than 1 or greater than 12.

In the same way, dates which includes as Days values lower than 1 or higher than 28-29, 30 or 31 depending on the month.