web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Answered

utcnow DateTimeStamp?

(0) ShareShare
ReportReport
Posted on by 11

Hi there,

 

I have tried to use utcnow() to make simple timestamps in flow, and it doesn't appear to work like it does in logic apps or other places.  Can someone confirm that it does or doesn't work, or what people's workarounds are?

 

Thanks,

Derek

Categories:
I have the same question (0)
  • v-monli-msft Profile Picture
    on at

    Hi Derek,

     

     

    This should be achievable if you create a condition and flip it to advanced mode. In the advanced mode, you can use the same expression syntax that Logic Apps uses. Expression reference is here: https://msdn.microsoft.com/en-us/library/mt643789.aspx

     

    So, start by using the editor to do a basic comparison with the timestamp field, then switch to the advanced view. This will tell you how to reference the field you care about in the expression.

     

    Regards,

    Mona Li

  • dkershner327 Profile Picture
    11 on at

    I am new to Flow, but know Logic apps well.  I am using the SQL > Insert Row action, and I do not see any "advanced mode".  I would definitely leave this advanced mode flipped on all of the time if I can find it.

  • Verified answer
    dkershner327 Profile Picture
    11 on at

    I re-read your post, and realized that you meant a condition that does nothing, but involves @utcnow().  I did this, and it doesn't seem to add anything to the dynamic content for me to use as a "Right now" timestamp while inserting to SQL underneath the condition.

  • dkershner327 Profile Picture
    11 on at

    I found one potential workaround: grab the current time from http://www.timeapi.org/utc/now .  Since flow doesn't charge by the action, it should be fine, although inefficient.

     

    If anyone has a better workaround, let me know.

  • patrickabel Profile Picture
    53 on at

    I had this exact problem yesterday and ended up using the http://www.timeapi.org/ as well.

     

    good call dkershner327!

  • Abou Profile Picture
    9 on at

    http://www.timeapi.org/ Site is not working.

  • dkershner Profile Picture
    4 on at

    Correct you are, I think too many of us probably used it.

     

    I now run a stored procedure in SQL for GETUTCDATE().  It's even less efficient, but will always work.

  • Abou Profile Picture
    9 on at

    Thank you for the tip.

    How would you get that in Flow?

  • dkershner Profile Picture
    4 on at

    SQL > Execute Stored Procedure

     

    For the procedure, you would just need something that either outputs the value into a table, and grab it that way, or as an output parameter to the procedure.

     

    Something like:

     

    CREATE PROCEDURE [dbo].[utcnow]
    -- Add the parameters for the stored procedure here
    @utcnow datetimeoffset(7) OUTPUT
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    -- Insert statements for procedure here

    SET @utcnow =(SELECT GETUTCDATE())


    UPDATE [dbo].[getutcdate]
    SET [timestamp]=@utcnow
    WHERE [id]=1
    END

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 323 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 183 Most Valuable Professional

Last 30 days Overall leaderboard