adjustSecond (NotesDateTime - JavaScript™)
Increments a date-time by a number of seconds.
Defined in
NotesDateTimeSyntax
adjustSecond(n:int) : void
Parameter | Description |
---|---|
n |
The number of seconds by which to increment the date-time. Can be positive or negative. |
preservelocaltime |
Affects adjustments that cross a daylight-saving time boundary. Specify true to increment or decrement the GMT time by one hour such that a 24-hour adjustment yields the same local time in the new day. If this parameter is false or omitted, GMT time remains as adjusted and local time gains or loses an hour. |
Usage
If theNotesDateTime
object
consists of only a date component, this method has no effect.Examples
This button posts a start time given the current time and the elapsed hours, minutes, and seconds.// Create valid NotesDateTime object and set to current time
var dt:NotesDateTime = session.createDateTime("Today 12");
dt.setNow();
// Get elapsed time
var hours = parseInt(requestScope.hour, 10);
var minutes = parseInt(requestScope.minute, 10);
var seconds = parseInt(requestScope.second, 10);
dt.adjustHour(-hours);
dt.adjustMinute(-minutes);
dt.adjustSecond(-seconds);
// Post start time
requestScope.startTime = dt.getLocalTime();