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 ?
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
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 😉
Hi @smistry,
You could use split() function convert the timestamp into an array, then restructure it by using index, for example:
Result:
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.
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 🙂
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
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?
I get this error when doing that :
It looks like I need a function that will convert DD/MM/YYYY to ISO-8601
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
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional