In Google Apps Script, you cannot just use after and before keyword in query. You’ll need the date to be converted to Epoch (seconds) first. Not even ISO 8601.
i.e Query to get GitHub Invocies for username chez14:
// Wrong:
from:[email protected] subject:"payment receipt" chez14 after:2024-08-04T15:10:40+07:00
// Correct:
from:[email protected] subject:"payment receipt" chez14 after:1722759040
On the UI, you can do that and the result may still come up, but in APIs, you have to provide Epoch.
Thanks to this comment:
- https://stackoverflow.com/questions/45029728/gmailapp-search-seems-to-fail-correct-data#comment77059962_45033558