cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Craigja
Helper II
Helper II

Cant get a date to format without the HH:MM:SS

I have a field (Due Date) that is a date field, I want to send an email if the due date is in 3 days time, to remind people to do training on time.

I have this formula addDays(formatDateTime(triggerOutputs()?['body/duedate'],'yyyy-MM-dd'), -3) but it seems to always return Due Date  = 2022-05-12T00:00:00.0000000  Why is it not removing the time from the end?  The due date field is a Sharepoint list, does this have something to do with it?

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @Craigja,

Have you resolved your problem?

Could you please share your flow with me?

 

Actually, if there is DueDate column existing in your list, you should loop through the list to check each due date.

vqiaqimsft_0-1652954184451.png

vqiaqimsft_1-1652954328240.png

formatDateTime(items('Apply_to_each')?['DueDate'],'yyyy-MM-dd')
addDays(utcNow(),-3,'yyyy-MM-dd')

 

Best Regards,
Qi

View solution in original post

Craigja
Helper II
Helper II

Yeah I eventually got it working by messing about with the formatting of the date, not sure what I was doing wrong

View solution in original post

3 REPLIES 3
ekarim2020
Super User
Super User

Try the following format for addDays function:

addDays('<timestamp>', <days>, '<format>')

example:
addDays('2022-05-12T10:10:10', -3,'yyyy-MM-dd') --> 2022-05-09

 
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

v-qiaqi-msft
Community Support
Community Support

Hi @Craigja,

Have you resolved your problem?

Could you please share your flow with me?

 

Actually, if there is DueDate column existing in your list, you should loop through the list to check each due date.

vqiaqimsft_0-1652954184451.png

vqiaqimsft_1-1652954328240.png

formatDateTime(items('Apply_to_each')?['DueDate'],'yyyy-MM-dd')
addDays(utcNow(),-3,'yyyy-MM-dd')

 

Best Regards,
Qi
Craigja
Helper II
Helper II

Yeah I eventually got it working by messing about with the formatting of the date, not sure what I was doing wrong

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (6,533)