Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 1qyuuuH21qYrjKYhlbLTTD
Power Automate - General Discussion
Answered

Format Date/TIme from utcNow() to Date Only and REMOVE Time?

Like (1) ShareShare
ReportReport
Posted on 13 Sep 2019 20:31:15 by 63

I'm tryin to feed the DATE ONLY into a SharePoint text field, using the utcNow().  I need to EXCLUDE/remove the date, and currently have it formatted as:

 

formatDateTime(utcNow('MM-dd-yyyy'))

 

The date is now fine, but how do I remove the time?

  • Kristamarie66 Profile Picture
    2 on 19 May 2023 at 17:11:18
    Re: Format Date/TIme from utcNow() to Date Only and REMOVE Time?

    utcNow('d) works too.

  • JohnGorena Profile Picture
    79 on 25 Apr 2023 at 21:17:34
    Re: Format Date/TIme from utcNow() to Date Only and REMOVE Time?

    1) The formula is looking for your dynamic data.  The "Loan maturity Date" seems to be just text and not a dynamic value like the CurrentUTCdate.  Fix that and see if it resolves.

    2) this problem should probably be on another thread as it doesn't relate to date formatting.

  • Sweta_P Profile Picture
    14 on 25 Apr 2023 at 20:54:06
    Re: Format Date/TIme from utcNow() to Date Only and REMOVE Time?

    Hi all, 

     

    I'm getting the following error when i try to run my flow. From what i gather, the system is picking up 2 different types of dates, how would i resolve this?

     

    Syntax error at position 13 in 'Loan Maturity Date Gt '2023-04-25T00:00:00.0000000' and Loan Maturity Date Lt '4/24/2025''.
    inner exception: Syntax error at position 13 in 'Loan Maturity Date Gt '2023-04-25T00:00:00.0000000' and Loan Maturity Date Lt '4/24/2025''.
    clientRequestId: aae50afd-0493-4ea7-bd81-7b1f4d48e3be

     

    Here are flow steps: 

    Sweta_P_0-1682456035050.png

     

  • JohnGorena Profile Picture
    79 on 23 Mar 2023 at 12:48:24
    Re: Format Date/TIme from utcNow() to Date Only and REMOVE Time?

    I posted this somewhere on this forum before but I cannot find it...   Here are examples from my notes....


    01)
    utcNow()
    2022-01-10T20:27:13.9480796Z

    02)
    formatDateTime(utcNow(),'yyyy-MM-dd tH:mm:ss')
    2022-01-10 P20:27:13

    03)
    formatDateTime(utcNow(),'yyyy-MM-dd TH:mm:ss')
    2022-01-10 T20:27:13

    04)
    formatDateTime (addHours(utcNow(), -6),'yyyy-MM-dd (H:mm:ss)')
    2022-01-10 (14:27:13)

    05)
    convertFromUtc(utcNow(), 'Central Standard Time' )
    2022-01-10T14:27:13.9480796

    06)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyy-MM-dd (HH:mm:ss)')
    2022-01-10 (14:27:13)

    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyyMMdd')
    20220110

    07)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyy-MM-dd , H:mm')
    2022-01-10 , 14:27

    08)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyyMMdd-HHmm')
    20220110-1427

    09)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyyMMdd @HHmm')
    20220110 @1427

    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyyMMdd')
    20220110

    10)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyy-MM-dd (H:mm:ss)')
    2022-01-10 (14:27:13)

    11)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyy-MM-dd (HHmm)')
    2022-01-10 (1427)

    12)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyy-MM-dd (H:mm:ss)')
    2022-01-10 (14:27:13)

    13)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyy-MM-dd (HH:mm:ss)')
    2022-01-10 (14:27:13)

    14)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyy-MM-dd (hh:mm:ss tt)')
    2022-01-10 (02:27:13 PM)

    15)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyy-MM-dd (h:mm:ss tt)')
    2022-01-10 (2:27:13 PM)

    16)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'g')
    1/10/2022 2:27 PM

    17)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'MM-dd-yyyy, h:mm tt')
    01-10-2022, 2:27 PM

    18)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'MM-dd-yyyy, h:mm:ss tt')
    01-10-2022, 2:27:13 PM

    19)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'yyyy-MM-dd, h:mm tt')
    2022-01-10, 2:27 PM

    20)
    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'MM/dd/yyyy')
    01/10/2022

    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'MM/dd/yyyy h:mm tt')
    01/10/2022 2:27 PM

     

  • JohnGorena Profile Picture
    79 on 23 Mar 2023 at 12:46:00
    Re: Format Date/TIme from utcNow() to Date Only and REMOVE Time?

    Write the format that you want or the format that works in a DATE Field..  Put it in a date field and not a text field.  Does that work?

  • MitheshRpa Profile Picture
    162 on 23 Mar 2023 at 10:24:09
    Re: Format Date/TIme from utcNow() to Date Only and REMOVE Time?

    If i use this syntax , i am getting it as text , but not date.

  • JohnGorena Profile Picture
    79 on 24 Mar 2022 at 04:01:18
    Re: Format Date/TIme from utcNow() to Date Only and REMOVE Time?

    formatDateTime(convertFromUtc(utcNow(), 'New Zealand Standard Time' ),'dd,MM,yyyy')

    will produce a format like 24,03,2022

     

     

  • ROKSTA1972 Profile Picture
    2 on 24 Mar 2022 at 00:59:21
    Re: Format Date/TIme from utcNow() to Date Only and REMOVE Time?

    @RezaDorrani can you convert UTC time to New Zealand Standard Time and then also format the date to "dd,mm,yy" in Power Automate

  • JohnGorena Profile Picture
    79 on 10 Jan 2022 at 20:39:36
    Re: Format Date/TIme from utcNow() to Date Only and REMOVE Time?

    or more accurately adjust for your time zone

     

    formatDateTime(convertFromUtc(utcNow(), 'Central Standard Time' ),'MM/dd/yyyy')

     

    The expression above shows a format like 01/10/2022 for Central Standar Time.

  • Community Power Platform Member Profile Picture
    on 05 Jan 2022 at 13:08:10
    Re: Format Date/TIme from utcNow() to Date Only and REMOVE Time?

    It worked for me now.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard