Reputation: 77
I have a flow where a user can fill in a datetime, i wish to check if the input date is not in the past and if the submission date time is less than today at 10:40 AM.
So i have to get the date from the inputfield en and the time from the submissiondate and check if they are less than today at 10:40am.
Which is the best way to achive this?
Upvotes: 0
Views: 517
Reputation: 11252
This isn't a complete solution but it gives you the kind of pattern you should consider.
I've broken it out for ease. This is the flow with the expressions at each step ...
I've converted the date and time to my own regional location, you should ultimately do the same.
formatDateTime(convertFromUtc(utcNow(), 'AUS Eastern Standard Time'), 'dd/MM/yyyy h:mm tt')
concat(formatDateTime(convertFromUtc(utcNow(), 'AUS Eastern Standard Time'), 'dd/MM/yyyy'), ' 10:40 AM')
less(parseDateTime(variables('Current DateTime')), parseDateTime(variables('Today 10:40 AM')))
The last step will produce the boolean comparison result that you can use in subsequent actions.
Upvotes: 1