cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tre4B Advocate IV
Advocate IV

Setting a precise time to the current date

I want to be able to set a date of Tomorrow at 0800hrs.  Ideally I'd like that to use my local settings so that BST etc is taken care of.

 

I can happily set a date for tomorrow using addDays(utcnow(),1).  What I cannot do is set the time.

 

I thought that I could do formatDateTime(addDays(utcnow(),1),'yyyy-MM-ddT08:00:00Z')  That sets the time to 1am.

 

formatDateTime(addDays(utcnow(),1),'yyyy-MM-ddT08:00:00+0Z') sets it to 6PM

 

formatDateTime(addDays(utcnow(),1),'yyyy-MM-ddT08:00:00+1:00Z') also sets it to 1AM

 

On the face of it what I want to do should not be difficult.  Can anyone give me a pointer on how to achieve this?

 

Trev    

2 REPLIES 2
Community Support
Community Support

Re: Setting a precise time to the current date

Hi @tre4B,

 

Thanks for your feedback, I think your thought is correct, we could use formatDateTime() function to achieve your needs. If you want to sent the time to 1 AM, I have made a test on my side and please take a try with the following workaround:

  • Add a proper trigger, here I use Flow Button trigger.
  • Add a "Compose" action, Inputs set to following formula:

 

formatDateTime(addDays(utcNow(),1),'yyyy-MM-ddT01:00:00Z')

 

Image reference:20.JPG

The flow works successfully as below:21.JPG

 

If you want to set the time to 6 PM, please modify the formula within above Inputs field of Compose action as below:

 

formatDateTime(addDays(utcNow(),1),'yyyy-MM-ddT18:00:00Z')

 

More details about using expression within flow actions, please check the following article:

Using expression within flow actions

 

 

Best regards,

Kris

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
tre4B Advocate IV
Advocate IV

Re: Setting a precise time to the current date

Interesting.  This could then be to do with the difference between the triggers.  Yours is manually produced and therefore probably from your machine which will be using your current Timezone.

 

Mine is triggering via the received mail.  Is it possible this causes the base timezone to vary?

 

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,083)