Hello Power Addicts,
I am trying to get all SharePoint list items whose "MyDate" column is having any date of previous month. I am using below filter query in Get Items action.
MyDate ge '@{startOfMonth(getPastTime(1,'Month'))}' and MyDate lt '@{startOfMonth(utcNow())}'
I dont know why but I dont get items dated 1st of previous month and I also get items dated 1st of current month. Both these cases shouldn't happen. My SharePoint site is in IST time zone. Should that be a problem as flow can understand only UTC. How should my filter query look like?
Thanks,
Ramesh
Hello @RameshMukka ,
I suppose the timezone could be the problem, the difference of 5 hours and 30 minutes could move the date to another day. You could try to convert the output from getPastTime(...) and utcNow(...) into the IST time zone with the convertFromUtc(...) expression:
e.g.
convertFromUtc(utcNow(),'India Standard Time')
MyDate ge '@{convertFromUtc(startOfMonth(getPastTime(1,'Month')),'India Standard Time')}' and MyDate lt '@{convertFromUtc(startOfMonth(utcNow()),'India Standard Time')}'
Below expression solved the problem
MyDate ge 'formatDateTime(startOfMonth(getPastTime(1,'Month')),'MM-dd-yyyy')' and MyDate lt 'formatDateTime(startOfMonth(utcNow()),'MM-dd-yyyy')'