Hi Community,
I have an input field bound to a variable of type time. Is there a simple way to format that time to display in a 24hr format? The app is reactive.
I found a lot of other posts in and around this topic, but couldn't find a definitive solution.
Thanks!
Hello Kristi,
Hope you're doing well.
In Reactive and Mobile Applications, when you are working on the Client-Side, it assumes the time of the client (and not of the Server). In this case, it is directly related to your browser.
I did publish your module and for me it appears my browser format and timezone:
Just try to change your time format in the browser and it should work as expected:
https://support.d4h.org/settings2/how-do-i-change-the-time-format
Hope that this helps you!
Kind regards,
Rui Barradas
Alright, we'll consider this. Thanks for your help everyone
Sure thing Kristi :)
Glad that we helped you.
Provided link for changing time format in browser is not working.
So I am adding other link providing instructions for Chrome, Firefox and Edge.
Solution also changes language of date picker, which is perfect because I looked for also this customisation.
Hi Kristi,
You can use the function NewTime(), exemple:
See the example .OML in attachment, screens CarParts(with local variable Time) and CarPartDetail(with DB field time ).
Hope this helps.
Regards.
Hi Agno,
Thanks for your suggestion, however it still renders in the 12hr format.
try like this example:
TextToTime(FormatDateTime(CurrTime(),"HH:mm:ss"))
When I do that, it just renders the default format - date on the 12 hr clock with no seconds. Did you publish that? Did it work?
Yes, it's work, can you share your .OML ?
I only published and running (without update):
google Chrome
your app:
See this post,
https://www.outsystems.com/forums/discussion/57522/time-input-with-pm-am-in-some-browsers-computers/
It's about browser and date format.
Hmm, I sort of figured - so there's no way to enforce a particular format?
Thanks for all your help!
Yes, you can try to do as Rui Barradas explained below.