【问题标题】:Apply DateTime filter for getting list messages in gmail using gmail API应用 DateTime 过滤器以使用 gmail API 在 gmail 中获取列表消息
【发布时间】:2016-10-24 00:55:42
【问题描述】:

我正在使用 GMAIL API 来获取日期范围之间的消息。我的问题是我的一个客户帐户的显示日期时间和实际接收日期/发送日期时间不同。有没有办法在 UTC 时区读取消息?

谢谢, 哈西娜

【问题讨论】:

  • 试图在 Gmail API 中查找此功能,但似乎没有提及这一点。尝试提交功能请求。我看到了你的SO post,目前似乎没有更新。
  • 这有什么更新吗?

标签: timezone gmail-api


【解决方案1】:

open issue 会影响搜索查询中日期的时区。不幸的是,目前没有解决方法。

【讨论】:

    【解决方案2】:
    $newTime = strtotime('-15 day');
    $after = strtotime(date('Y-m-d H:i:s', $newTime));
    
    $opt_param = array();
    
    $userId = 'me';
    $opt_param['q'] = "after:$after";
    
    $messagesResponse = $service->users_messages->listUsersMessages($userId, $opt_param);
    

    【讨论】:

    猜你喜欢
    • 2016-03-18
    • 1970-01-01
    • 2021-10-12
    • 2021-05-20
    • 2016-09-21
    • 2017-04-04
    • 2018-07-06
    • 2016-11-25
    • 1970-01-01
    相关资源
    最近更新 更多