[Date->Month] is an accessor for getting or setting the day of month field for a date object.
Getting uses no parameters and returns the month as an integer (1=January, 12=December). An optional -Long parameter returns the full English month name (e.g. "January"). An optional -Short parameter returns an abbreviated English month name (e.g. "Jan").
Setting requires an integer parameter, and supports the =, += and -= operators. Setting modifies the date object in-place, but does not return a value.
Date Object->month Date Object->month(-long) Date Object->month(-short) Date Object->month=Integer Date Object->month+=Integer Date Object->month-=Integer
Use the [Date->Month] method. The following example uses a single date object, then gets the month and returns its value as the full name in English.
Next we set the month field to a new value using the = operator, then set it again by adding 1 to the month using the += operator, and set it once more by subtracting 1 from the month using the -= operator. We return the result for each set operation.
local(d) = date('2011-02-21 08:00:00') #d->month(-long) + '<br>' #d->month=5 #d + '<br>' #d->month+=1 #d + '<br>' #d->month-=1 #d
February 2011-05-21 08:00:00 2011-06-21 08:00:00 2011-05-21 08:00:00
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 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft