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 Platform Community / Forums / Power Apps / Incorrect date conversion
Power Apps
Answered

Incorrect date conversion

(0) ShareShare
ReportReport
Posted on by 149

Hi,

I have a SP List in which the date and time are stored as text string:

 

dd/mm/yyyy hh:mm

 

I am using AddColumn in a collect statement to convert this text string to DateTimeValue

 

ClearCollect(colB,Sort(AddColumns(MA_Timetable_2,"START",DateTimeValue(EventStart),"END",DateTimeValue(EventEnd)),ID,Ascending))

 

The problem is the date is being converted incorrectly.

 

Mo_Islam_1-1603410949596.png

 

Any help or guidance would be much appreciated.

 

What am I doing wrong?

 

Thank you

Categories:
I have the same question (0)
  • Verified answer
    CU-18081211-6 Profile Picture
    9,270 Moderator on at

    Hi @Mo_Islam ,

    You are using a "dd/mm/yyyy" system to collect your data as text in SharePoint and DateTimeValue recognized datetime type implicit in "mm/dd/yyyy". That why the conversion gives a datetime value where your day is recognized as month (because is greater that 12 it add a year and give you the remaining month), and your month is recognized as day.

     

    In other words to solve your problem, you have to set language_code parameter of function DateTimeValue to one similar to your data format saved in Sharepoint (i think "fr").

     

    Your new formula is: 

    ClearCollect(colB,Sort(AddColumns(MA_Timetable_2,"START",DateTimeValue(EventStart,"fr"),"END",DateTimeValue(EventEnd,"fr")),ID,Ascending))

    and should working fine.

     

    Hope it helps ! 

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 361

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard