如何在Google脚本中设置和获取日期?

问题描述 投票:0回答:1

在javascript中,我们通常会var date = new Date(),如果我们想稍后再进行比较var newDate = date.setSeconds(1000)现在我们可以比较date 与否[>

我正在写一个gmail插件,因为我需要使用类似的东西。如何在Google脚本中执行此操作。

我试图在Google脚本文档中找到它,但我找不到它。有人可以帮我吗?

<< >
google-apps-script google-api gsuite google-apps-marketplace gmail-addons
1个回答
0
投票
Apps Script仍将JavaScript new Date()定义用于日期,尽管当您使用date.setSeconds(1000)时日期已转换为Unix时间。 Google使用Unix时间(以毫秒为单位)。

调用date.setSeconds()

即使在内部调用也更改变量日期

© www.soinside.com 2019 - 2024. All rights reserved.