Lasso Soft Inc. > Home

[ date->millisecond ]

Method

[Date->Millisecond] is an accessor for getting or setting the millisecond field for a date object.

Getting uses no parameters and returns the millisecond as an integer.

Setting requires an integer parameter, and supports the =, += and -= operators. Setting modifies the date object in-place, but does not return a value.

  • Syntax
Date Object->millisecond
Date Object->millisecond=Integer
Date Object->millisecond+=Integer
Date Object->millisecond-=Integer
Examples
  • Beginner

To get or set the millisecond field of a date object:

Use the [Date->Millisecond] method. The following example uses a single date object, then gets the millisecond and returns its value.

Next we set the millisecond field to a new value using the = operator, then set it again by adding 1 to the millisecond using the += operator, and set it once more by subtracting 1 from the millisecond using the -= operator. We return the result for each set operation.

Code

local(d) = date
#d->millisecond + '<br>'
#d->millisecond=5
#d + '<br>'
#d->millisecond+=1
#d + '<br>'
#d->millisecond-=1
#d

Result

269
5
6
5
Resources
  • Tips

In practical usage, the developer would use only the current date for the date object.

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