Office.LocalClientTime interface

表示本地客户端时区中的日期和时间。 仅限阅读模式。

注解

最低权限级别读取项

适用的 Outlook 模式:读取

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-start-read.yaml

const time = Office.context.mailbox.item.start;
const localTime = Office.context.mailbox.convertToLocalClientTime(time);
console.log(`Appointment starts (local): ${localTime.month + 1}/${localTime.date}/${localTime.year}, ${localTime.hours}:${localTime.minutes}:${localTime.seconds}`);

属性

date

表示月份中的某一天的整数值。

hours

表示 24 小时时钟的小时的整数值。

milliseconds

表示毫秒的整数值。

minutes

表示分钟的整数值。

month

表示月份的整数值,从 0(表示 1 月)开始到 11(表示十二月)。

seconds

表示秒的整数值。

timezoneOffset

表示本地时区与 UTC 之间的分钟数差异的整数值。

year

表示年份的整数值。

属性详细信息

date

表示月份中的某一天的整数值。

date: number;

属性值

number

hours

表示 24 小时时钟的小时的整数值。

hours: number;

属性值

number

milliseconds

表示毫秒的整数值。

milliseconds: number;

属性值

number

minutes

表示分钟的整数值。

minutes: number;

属性值

number

month

表示月份的整数值,从 0(表示 1 月)开始到 11(表示十二月)。

month: number;

属性值

number

seconds

表示秒的整数值。

seconds: number;

属性值

number

timezoneOffset

表示本地时区与 UTC 之间的分钟数差异的整数值。

timezoneOffset: number;

属性值

number

year

表示年份的整数值。

year: number;

属性值

number