`gm_threads()` uses a different time zone than mail.google.com

I have noticed something strange when searching with {gmailr} for emails sent on a particular date. If I go out to mail.google.com and filter for e.g. "after:2020/8/2 before:2020/8/3", I get emails received on 2020/8/2 in my current time zone, central time (as expected). However, if I run gm_threads("after:2020/8/2 before:2020/8/3") from an R session, it appears to grab something like emails received between 8PM on 8/1 and 8PM on 8/2 central time. So the correct date, but in a time zone 4 hours different. Is there a way to specify time zone with gm_threads()?

Note: If I then call gm_date() for each of the IDs that I got, it gives the appropriate date in central time. So I do have a workaround, which is to pull two days at a time and filter out what I actually need. It seems wasteful though, and I'd like to understand what's going on.

I know I can't do a full reprex because we can't look at the same data, but let me know if more of my actual code would be helpful.

1 Like

I think you could provide a bit of code, for someone to investigate. But this seems like something that should be filed as an issue on gmailr.

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.