python-o365
python-o365 copied to clipboard
How to read only last 30mins mails???? | URGENT
date_time = dt.datetime.now() last30MinuteDateTime = dt.datetime.now() - dt.timedelta(minutes=30) yr = int(date_time.strftime("%Y")) mnth = int(date_time.strftime("%m")) dte = int(date_time.strftime("%d")) hrs = last30MinuteDateTime.hour mint = last30MinuteDateTime.minute
print(yr, mnth, dte, hrs, mint) ##printing current date with hours and minute query = query.chain('and').on_attribute('created_date_time').greater(dt.datetime (yr, mnth, dte, hrs, mint)) print(query) current time 5:01
Output is below : 2021 3 1 4 31 ---> ##prints last 30minute ago time correctly that is 4:31 Filter: isRead eq false and createdDateTime gt 2021-03-01T09:31:00+00:00 ( what time is this referring to????)
Please help here
I don't understand your question...