setNow (NotesDateTime - JavaScript)

Sets the value of a date-time to the current date and time.

Defined in

NotesDateTime

Syntax

setNow() : void

Usage

For remote (IIOP) operations, the date-time value is based on the host computer. For local operations, the date-time value is based on the computer on which the program is running.

This method works by taking a snapshot of the current date-time at the moment that the method is executed. After the method executes, the value of the NotesDateTime object does not update itself to always reflect the current date-time. Its value only changes if you change it explicitly.

Examples

This button creates or replaces the PurgeDate item in the current document.
var doc:NotesDocument = currentDocument.getDocument();
var dt:NotesDateTime = session.createDateTime("Today 12");
dt.setNow();
dt.adjustMonth(2);
doc.replaceItemValue("PurgeDate", dt);
doc.save();