简体   繁体   English

Google 应用程序脚本 Gmail 最旧线程日期

[英]Google apps script Gmail oldest thread date

I write script for find first written thread in Gmail.我编写脚本以在 Gmail 中查找第一个书面线程。 How using google apps script get oldest thread date in inbox?如何使用谷歌应用程序脚本获取收件箱中最旧的线程日期?

var thread = GmailApp.getInboxThreads(0,1)[0]; 
var message = thread.getMessages()[0]; // Get first message 
Logger.log(message.getDate()); // Log date and time of the message

UPDATED: You can use the below snippet.更新:您可以使用以下代码段。

var thread = GmailApp.getInboxThreads(0,1)[0];
var message = thread.getMessages()[0]; // Get first message
Logger.log(message.getDate()); // Log date and time of the message

Please refer the link .请参考链接

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

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