跳到主要内容

SetTimeUTC

设置 UTC 格式的批注回复创建时间戳。

语法

expression.SetTimeUTC(nTimeStamp);

expression - 表示 ApiCommentReply 类的变量。

参数

名称必需/可选数据类型默认值描述
nTimeStamp必需Number | StringUTC 格式的批注回复创建时间戳。

返回值

此方法不返回任何数据。

示例

设置电子表格中批注回复的 UTC 时间戳。

// How do I store the creation time of a comment reply as a UTC value in a spreadsheet?

// Assign a universal coordinated time to an existing comment reply in a spreadsheet.

let worksheet = Api.GetActiveSheet();
worksheet.GetRange("A1").SetValue("1");
let range = worksheet.GetRange("A1");
let comment = range.AddComment("This is just a number.");
comment.AddReply("Reply 1", "John Smith", "uid-1");
let reply = comment.GetReply();
reply.SetTimeUTC(Date.now());
worksheet.GetRange("A3").SetValue("Comment's reply timestamp UTC: ");
worksheet.GetRange("B3").SetValue(reply.GetTimeUTC());