Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
532 views
in Technique[技术] by (71.8m points)

powerapps - I need to change the date format in power apps

i am trying to built an app in powerapps which will send an event in outlook calendar. i have create a flow i test it and works fine but i have to insert the date in "yyyy/mm/dd" format. when i try to add the flow in powerapps, the powerapps send the date in "dd/mm/yyyy" format and the flow doesn't recognize it as a date and doesn't send the event in calendar. i have insert this on the button action...

Προσθ?κηστοημερολ?γιο.Run(DateTimeValue(DateValue1.SelectedDate & " " & HourValue1.SelectedText.Value  & ":" & MinuteValue1.SelectedText.Value) & DateTimeFormat = "yyyy/mm/dd hh:mm:")

thank you in advance!

question from:https://stackoverflow.com/questions/65836245/i-need-to-change-the-date-format-in-power-apps

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Arguments from Power Apps to flows are always of type strings, so you don't need the DateTimeValue (which converts from strings to date/time). You need the Text function, which allows you to format a date/time value in a specific way, something like the expression below:

Προσθ?κηστοημερολ?γιο.Run(
    Text(DateValue1.SelectedDate, "yyyy/mm/dd") & " " &
    Text(
        Time(HourValue1.SelectedText.Value, MinuteValue1.SelectedText.Value, 0),
        "hh:mm:ss"))

If the types of [HourValue1 | MinuteValue1].SelectedText.Value is not a number (i.e., they are strings), then you may be able to concatenate them directly instead of using the Text and Time functions:

Προσθ?κηστοημερολ?γιο.Run(
    Text(DateValue1.SelectedDate, "yyyy/mm/dd") & " " &
    HourValue1.SelectedText.Value & ":" & MinuteValue1.SelectedText.Value & ":00")

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...