我可以从 Actions On Google 获取请求者的本地时间(或偏移量)吗?

Can I get requester's local time (or offset) from Actions On Google?

我正在使用 API.ai 在 Google API 上进行操作。为了完成我的一项操作,我需要知道用户的位置和当地时间。

我已经能够成功请求并收到用户的位置信息。

但是,我看不到任何获取用户本地时间或时区偏移量的方法。有办法吗?

(我知道我可以使用该位置找出偏移量,但这需要另一个 API 调用或使用另一个库,我宁愿避免。)

提前致谢。

--更新--

根据下面 Leon 的回答,截至 2017 年 1 月 18 日,API 当前未提供此信息。为了获得所需的信息,我请求了用户精确位置的许可,即 returns 纬度和经度。然后我使用 GeoNames 时区 API 来获取时区偏移量。

设备的时区尚未提供给操作。

虽然据我所知,时区本身并未包含在内。您可以在图书馆旁边使用位置权限来动态获取当地时间。

我在这里使用的库是 momentTz 和 timezone。后者从位置许可提供的 lat/long 中插入时区。然后使用已解析的时区将 momentTz 本地提供的 UTC 标准时间转换为本地时间。

const startTz = momentTz(); //Returns standard UTC time, independent of locality
const timestamp = 1402629305; // Any random timestamp will work, it wouldn't unnecessarily impede your results 

timezone.data(latitudeValue, longitudeValue, timestamp, function(err, tz) {
  if (err) {
    console.log(err);
  }

var zoneHolder = tz.raw_response.timeZoneId; //Appropriate timezone is returned here based on latitudeValue and longitudeValue passed
const localTime = startTz.tz(zoneHolder).format('LLL'); //local time which you seek;
});