python-o365 icon indicating copy to clipboard operation
python-o365 copied to clipboard

How to read only last 30mins mails???? | URGENT

Open smalhot9464 opened this issue 4 years ago • 1 comments

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

smalhot9464 avatar Mar 01 '21 10:03 smalhot9464

I don't understand your question...

alejcas avatar Mar 02 '21 09:03 alejcas