【问题标题】:how to get emails newer than a specific date and time in gmail API php如何在gmail API php中获取比特定日期和时间更新的电子邮件
【发布时间】:2018-04-03 04:05:05
【问题描述】:

我想知道如何使用 php 中的 Gmail API 获取比日期和时间更新的电子邮件。喜欢2017-10-21 09:00:47。我使用了查询参数newer_than,但它没有用。然后我用了after: 2017-10-21 09:00:47 它也没有用。然后我做了这样的事情。

<?php
$time = strtotime('2017-10-21 09:00:47');
// and passed it in query like this
$query = "after: $time";
?>

它现在获取结果,但它包括当时收到的消息。我不想包含当时的消息。如何排除它们?

【问题讨论】:

    标签: php email gmail-api


    【解决方案1】:

    您仍然可以使用after,但将日期转换为秒并使用它。

    假设您希望收到晚于Friday, October 20, 2017 11:59:59 PM 的消息。然后,您将在查询中写入 after:1508543999

    【讨论】:

    • 兄弟,做同样的事情。它包括时间的所有消息Friday, October 20, 2017 11:59:59 PM。我想要 Friday, October 20, 2017 11:59:59 PM 之后的消息。不应包含当时的消息。
    猜你喜欢
    • 2021-08-04
    • 2014-08-19
    • 2018-03-26
    • 2021-06-24
    • 2014-03-13
    • 2018-10-15
    • 2021-01-02
    • 2021-02-14
    • 2021-08-29
    相关资源
    最近更新 更多