Lasso Soft Inc. > Home

[ date->set ]

Method

[Date->Set] sets the current value for one field of the date. Requires one of the following keyword parameters. Setting modifies the date object in-place, but does not return a value.

Only one field value can be set at a time. Note that many of the more common fields can also be set through individual methods.

Keyword Description
-year Sets the year field for the date.
-month Sets the month field for the date.
-week Sets the week field for the date.
-day Sets the day field for the date.
-hour Sets the hour field for the date.
-minute Sets the minute field for the date.
-second Sets the second field for the date.
-weekofyear Sets the week of year field for the date.
-weekofmonth Sets the week of month field for the date.
-dayofmonth Sets the day of month field for the date.
-dayofyear Sets the day of year field for the date.
-dayofweek Sets the day of week field for the date.
-dayofweekinmonth Sets the day of week in month field for the date.
-ampm Sets the am/pm field for the date.
-hourofday Sets the hour of day field for the date.
-zoneoffset Sets the time zone offset field for the date.
-dstoffset Sets the dst offset field for the date.
-yearwoy Sets the year week of year field for the date.
-dowlocal Sets the local day of week field for the date.
-extendedyear Sets the extended year field for the date.
-julianday Sets the julian day field for the date.
-millisecondsinday Sets the milliseconds in day field for the date.
  • Syntax
  • Methods
  • Traits
Date Object->set(-year)
Date Object->set(-month)
Date Object->set(-week)
Date Object->set(-day)
Date Object->set(-hour)
Date Object->set(-minute)
Date Object->set(-second)
Date Object->set(-weekofyear)
Date Object->set(-weekofmonth)
Date Object->set(-dayofmonth)
Date Object->set(-dayofyear)
Date Object->set(-dayofweek)
Date Object->set(-dayofweekinmonth)
Date Object->set(-ampm)
Date Object->set(-hourofday)
Date Object->set(-zoneoffset)
Date Object->set(-dstoffset)
Date Object->set(-yearwoy)
Date Object->set(-dowlocal)
Date Object->set(-extendedyear)
Date Object->set(-julianday)
Date Object->set(-millisecondsinday)
Has methods:
Examples
  • Beginner

To set the current value for one field of a date object:

Use the [Date->Set] method. The following example sets the -year field of the date object, then we return the date.

Code

local(d) = date('2011-02-21 08:00:00')
#d->set(-year=2022)
#d

Result

2022-02-21 08: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 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft