Lasso Soft Inc. > Home

[Valid_Date]

[Valid_Date] checks whether a string contains a valid date or not. The tag returns True if the parameter is in a format that Lasso can parse or False otherwise.

Built-in date formats include U.S. date format '7/4/2003 12:34:56', MySQL date format '2003-07-04 12:34:56' and others. See the [Date] tag for a full list of supported formats.

If an optional -Format parameter is specified then the date string will be checked against that format. See the [Date] tag for a full list of tokens which can be used in the -Format parameter.

  • Syntax
  • Parameters
[If: (Valid_Date: '12/31/1987')] ... [/If]

[If: (Valid_Date: '1987-12-31')] ... [/If]

[If: (Valid_Date: '31|1987|12', -Format='%d|%Y|%m')] ... [/If]
Required Parameters
Date String The date string to be inspected.
Optional Parameters
-Format Optional format to check the date string against.
Examples

To check whether a tag is valid:

Use the [Valid_Date] tag. The following example tests several different dates to see if they are valid or not. Either True or False is returned for each test.

[Valid_Date: '12/25/2003']
[Valid_Date: 'Christmas']
[Valid_Date: '2003-12-25 1:35:35']
Result:
True
False
True
Tag Link [Valid_Date] Category Utility
Type Substitution Data Source Any
Support Preferred Version 7.0
Output Type Boolean Security None
Implementation Sets Lasso 7.0

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft