Lasso Soft Inc. > Home

[ date->parse ]

Method

[Date->Parse] compares a string parameter against a date format. Returns True if the string parameter is in the proper date format or otherwise False.

An optional -Format parameter specifies the format against which to compare the string. Defaults to '%Q %T'.

An optional -Locale parameter specifies the locale against which to compare the string. Defaults to the operating system default locale.

  • Syntax
Date Object->parse('String Parameter')
Date Object->parse('String Parameter', -format='Format String')
Date Object->parse('String Parameter', -locale='Locale String')
Examples
  • Beginner

To test whether a string is in a given date format:

Use the [Date->Parse] method. The following examples test whether a string parameter is in the given date format.

Code

date('2011-02-19 16:33:48')->parse('2011-02-01')
date('2011-02-19 16:33:48')->parse('20110201012345', -format='%q')

Result

false
true

Recent Comments

No Comments found

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