How do i change the date and time picker from 24-hr to 12-hr format.
This is what is already in the data card:
DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)
I located a previous solution, when I enter this it does not work:
AmPmValue1.Items: ["AM", "PM"] AmPmValue1.Default: If(Hour(Parent.Default) < 12, "AM", "PM") HourValue1.Items: ["12","01","02","03","04","05","06","07","08","09","10","11"] HourValue1.Default: Text(If(Mod(Hour(Parent.Default), 12) = 0, 12, Mod(Hour(Parent.Default), 12)),"00") DataCard1.Update: DateValue1.SelectedDate + Time(If(AmPmValue1.Selected.Value = "PM", 12, 0) + Mod(Value(HourValue1.Selected.Value), 12), Value(MinuteValue1.Selected.Value), 0)
This link that references a formula doesn't tell you how to insert to change: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-clock-calendar
Solved! Go to Solution.
I have copied and pasted the code you supplied into a test app and everything works fine for me. Your post says your code does not work. Could you please tell me what specifically does not work with your code?
hello @mdevaney ,
I am just now catching and issue. I separated the update like you previously mentioned, but now when PM is selected it automatically changes to AM once you submit. Why isn't the PM working?
Your last post on this thread was over a month ago. I suggest you create a new thread and explain the problem you are now having there instead.
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
This will be a conference that you do not want to miss!
Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.
Check out the winners of the recent 'Can You Solve These?' community challenge!
Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.
Featuring samples like Return to the Workplace and Emergency Response Applications
Features releasing from October 2020 through March 2021