cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DavidMullett
Helper I
Helper I

DateTimeValue will not set as GB?

Hi,

 

I have the following code but when I do it through the powerapp on a mobile device or accessing it directly it works fine however when I access through a Sharepoint site, even though the region is set to English UK, it thinks the 5/1/2022 is June!

 

Set(
    selectedDate,
    Calendar_1.StartDate
);
Set(
    selectedEndDate,
    Calendar_1.EndDate
);
Set(
    startTime,
        DateTimeValue(Text(
            selectedDate,
            "dd/mm/yyyy"
        ) & " " & ddTimeFrom.Selected.Value
    )
);
Set(
    endTime,
    If(
        DateValue(
            Text(
                selectedEndDate,
                "dd/mm/yyyy"
            )
        ) < DateValue(
            Text(
                selectedDate,
                "dd/mm/yyyy"
            )
        ),
        DateTimeValue(
            Text(
                selectedDate,
                "dd/mm/yyyy"
            ) & " " & ddTimeTo.Selected.Value
        ),
        DateTimeValue(
            Text(
                selectedEndDate,
                "dd/mm/yyyy"
            ) & " " & ddTimeTo.Selected.Value
        )
    )
);

 

How do I get the startTime to stick to dd/mm/yyyy ??

 

Thanks

 

David

1 REPLY 1
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @DavidMullett ,

You can try with below Approach.

You need to force the Variable also contains the Same formate you expect.

LIke below - 

Set(
    selectedDate,
    DateTimeValue(Calendar_1.StartDate,"dd/MM/yyyy")
);
Set(
    selectedEndDate,
     DateTimeValue(Calendar_1.EndDate,"dd/MM/yyyy")
);

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,352)