简体   繁体   English

通过在Android中使用Gmail API,我希望通过过滤特定电子邮件地址的两个日期之间的Gmail数据

[英]By Using Gmail API in android, I want gmail data by filtering between two dates of particular email address

I am using Gmail API and I want data between two dates. 我正在使用Gmail API,并且需要两个日期之间的数据。

Here is my code for query which currently I am using. 这是我当前正在使用的查询代码。

listMessagesMatchingQuery(mService, user, "abc@gmail.com");

Tell me how to pass two dates and email address to get the proper response 告诉我如何传递两个日期和电子邮件地址以得到正确的回复

And I am getting response like 我得到像

  {
  "id" : "1622745d8ee96a59",
  "threadId" : "1622745d8ee96a59"
  }

but without date. 但没有日期。

You can give seconds since the epoch to after and before in your query to get messages between two dates. 你可以给从纪元秒, afterbefore在查询两个日期间获得的消息。

If you would like messages from abc@gmail.com sent between Wed, 04 Apr 2018 00:00:00 GMT and Thu, 05 Apr 2018 00:00:00 GMT you would write: 如果您希望在Wed, 04 Apr 2018 00:00:00 GMTWed, 04 Apr 2018 00:00:00 GMT Thu, 05 Apr 2018 00:00:00 GMT之间发送的来自abc@gmail.com消息,您可以编写:

listMessagesMatchingQuery(mService, user, "from:abc@gmail.com after:1522800000 before:1522886400");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM