Skip to main content

Notifications

Community site session details

Community site session details

Session Id : T/N793X9Kh77CCncZUsbhL
Power Automate - Building Flows
Answered

Convert date format from DD/MM/YYYY to timestamp

Like (0) ShareShare
ReportReport
Posted on 19 Jun 2020 14:08:15 by 10

I have a string date in the UK format "DD/MM/YYYY" when I insert this into a sharepoint date column it gets parsed as "MM/DD/YYYY". 

 

So when I insert "01/02/1990" (1st Feb 1990) it gets inserted as 2nd Jan 1990.

 

Is there a way to convert  "DD/MM/YYYY" to a timestamp (YYYY-MM-DD) so that the date can be inserted correctly. ?

 

I have looked at the formatDateTime function but the first argument to that expects only YYYY-MM-DD ?

  • v-litu-msft Profile Picture
    on 24 Jun 2020 at 07:08:28
    Re: Convert date format from DD/MM/YYYY to timestamp

    Hi @Anonymous,

     

    Yeah, after I finished writing the reply, I found that you have written a similar method in the latest reply, and your method is very good.

     

    Best Regards,
    Community Support Team _ Lin Tu

  • Community Power Platform Member Profile Picture
    on 22 Jun 2020 at 14:20:08
    Re: Convert date format from DD/MM/YYYY to timestamp

    So it's same what I wrote however its only date string not timestamp. To get timestamp you need to add time to date as I wrote before 😉

  • v-litu-msft Profile Picture
    on 22 Jun 2020 at 03:39:07
    Re: Convert date format from DD/MM/YYYY to timestamp

    Hi @smistry,

     

    You could use split() function convert the timestamp into an array, then restructure it by using index, for example:

    Annotation 2020-06-22 113540.jpg

     

    Result:

    Annotation 2020-06-22 113845.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Verified answer
    Community Power Platform Member Profile Picture
    on 19 Jun 2020 at 17:35:02
    Re: Convert date format from DD/MM/YYYY to timestamp

    Hi!

    You need to transcript your date into timestamp like that: 2020-06-19T17:26:02.1821723Z

    So you need:

    1. Use split expression and separate your date

    2. Use concat 

     

    concat(split('DD/MM/YYYY','/')[2],'-',split('DD/MM/YYYY','/')[1],'-',split('DD/MM/YYYY','/')[0],'-00T00:00:00.0000000Z') Here u have timestamp 🙂 

     

     

  • MJain Profile Picture
    2,450 on 19 Jun 2020 at 16:50:20
    Re: Convert date format from DD/MM/YYYY to timestamp

    Hi @smistry ,

     

    If you know your source date format is fixed(UK) and destination format is also fixed , try to use formatDateTime from source and convert to Destination before inserting.

     

    Thanks

  • smistry Profile Picture
    10 on 19 Jun 2020 at 15:27:45
    Re: Convert date format from DD/MM/YYYY to timestamp

    I can't use that solution because the date comes from the user in the format 'DD/MM/YYYY' so I cant change it.

     

    In C# I could do this : 

     

    DateTime.ParseExact("24/01/2013", "dd/MM/yyyy", CultureInfo.InvariantCulture);

    Is there a way to do this in Power Flow?

  • MJain Profile Picture
    2,450 on 19 Jun 2020 at 15:22:45
    Re: Convert date format from DD/MM/YYYY to timestamp

    Hi @smistry ,

     

    Please refer to similar thread to convert this date 

     

    https://powerusers.microsoft.com/t5/Building-Flows/The-datetime-string-must-match-ISO-8601-format/td-p/383056

     

    Thanks

     

  • smistry Profile Picture
    10 on 19 Jun 2020 at 15:10:09
    Re: Convert date format from DD/MM/YYYY to timestamp

    I get this error when doing that : 

     

     

    convert_timezone_error.png

     

     

    convert_tz_options.png

     

    It looks like I need a function that will convert DD/MM/YYYY to ISO-8601

  • MJain Profile Picture
    2,450 on 19 Jun 2020 at 14:16:09
    Re: Convert date format from DD/MM/YYYY to timestamp

    Hi @smistry ,

     

    You need to use convert time zone action to convert your date from source timezone to destination time zone before creating record.

     

    Thanks

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard