Lasso Soft Inc. > Home

[ date->AM ]

Method

[Date->AM] is an accessor for getting or setting the AM/PM field for a date object.

Getting uses no parameters and returns boolean true if the date is AM, otherwise false.

Setting requires a boolean parameter, and supports the = operator. If set to true, then the date is converted to AM. Conversely if set to false, then the date is converted to PM. Setting modifies the date object in-place, but does not return a value.

  • Syntax
Date Object->am
Date Object->am=Boolean
Examples
  • Beginner

To test whether a date is AM, or set the AM field of a date object:

Use the [Date->AM] method. The following example uses a single date object, then tests whether the date is AM, and returns true.

Next we set the AM field to a new value using the = operator. We return the result for the set operation.

Code

local(d) = date('2011-02-01 08:00:00')
#d->am + '<br>'
#d->AM=false
#d

Result

true
2011-02-01 20:00:00

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 2014 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft