Office.Time interface

The Time object is returned as the start or end property of an appointment in compose mode.

[ API set: Mailbox 1.1 ]

Remarks

Minimum permission levelReadItem
Applicable Outlook modeCompose

Methods

getAsync(options, callback)

Gets the start or end time of an appointment.

The date and time is provided as a Date object in the asyncResult.value property. The value is in Coordinated Universal Time (UTC). You can convert the UTC time to the local client time by using the convertToLocalClientTime method.

[ API set: Mailbox 1.1 ]

setAsync(dateTime, options, callback)

Sets the start or end time of an appointment.

If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time.

The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method.

[ API set: Mailbox 1.1 ]

Method Details

getAsync(options, callback)

Gets the start or end time of an appointment.

The date and time is provided as a Date object in the asyncResult.value property. The value is in Coordinated Universal Time (UTC). You can convert the UTC time to the local client time by using the convertToLocalClientTime method.

[ API set: Mailbox 1.1 ]

getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void;
Parameters
options
Office.AsyncContextOptions

An object literal that contains one or more of the following properties. asyncContext: Developers can provide any object they wish to access in the callback method.

callback
(result: AsyncResult) => void

When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.

Returns
void
Remarks
Minimum permission levelReadItem
Applicable Outlook modeCompose

In addition to the main signature, this method also has this signature:

getAsync(callback: (result: AsyncResult) => void): void;

setAsync(dateTime, options, callback)

Sets the start or end time of an appointment.

If the setAsync method is called on the start property, the end property will be adjusted to maintain the duration of the appointment as previously set. If the setAsync method is called on the end property, the duration of the appointment will be extended to the new end time.

The time must be in UTC; you can get the correct UTC time by using the convertToUtcClientTime method.

[ API set: Mailbox 1.1 ]

setAsync(dateTime: Date, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
Parameters
dateTime
Date

A date-time object in Coordinated Universal Time (UTC).

options
Office.AsyncContextOptions

An object literal that contains one or more of the following properties. asyncContext: Developers can provide any object they wish to access in the callback method.

callback
(result: AsyncResult) => void

When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the date and time fails, the asyncResult.error property will contain an error code.

Returns
void
Remarks
Minimum permission levelReadWriteItem
Applicable Outlook modeCompose
ErrorsInvalidEndTime - The appointment end time is before the appointment start time.

In addition to the main signature, this method also has these signatures:

setAsync(dateTime: Date): void;

setAsync(dateTime: Date, options: Office.AsyncContextOptions): void;

setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void;