How can we code, when we get email between 7pm and 9pm?
This is what advanced contain produced..
@contains(triggerBody()?['DateTimeReceived'], '')
Hi @Jpineiro,
Microsoft Flow handles time in UTC format, so in order to make the flow to work with your local timezone, here we take use of the addhours function to add the UTC offset.
For example, in Beijing TimeZone, the formula below would Add 8 hours.
Addhours(triggerBody()?['DateTimeReceived'],8,'HH:ss')
Please find your timezone and then modify the 8 with the UTC offset for your timezone.
So the whole formula for the condition should be:
@and( GreaterOrequals( Addhours(triggerBody()?['DateTimeReceived'],UTCoffset,'HH:ss'), formatDateTime('19:00','HH:ss') ), lessOrEquals( Addhours(triggerBody()?['DateTimeReceived'],UTCoffset,'HH:ss'), formatDateTime('21:00','HH:ss') ) )
Regards,
Michael
Thank You. I'm in EST, and have been trying this (this morning) with no success. Condition always comes back false though email is recieved between 6am and 10am. I tried -5 too, with no luck. Thanks!
@and(
GreaterOrequals(
Addhours(triggerBody()?['DateTimeReceived'],5,'HH:ss'),
formatDateTime('6:00','HH:ss')
),
lessOrEquals(
Addhours(triggerBody()?['DateTimeReceived'],5,'HH:ss'),
formatDateTime('10:00','HH:ss')
)
)