8
Views
13
Comments
Solved
Time Format on an Input Field
Question

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!

Rank: #94
Solution

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

Rank: #1678

Alright, we'll consider this. Thanks for your help everyone

Rank: #94

Sure thing Kristi :)

Glad that we helped you.


Kind regards,

Rui Barradas

Rank: #170

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.


ExampleKris.oml

Rank: #1678

Hi Agno,

Thanks for your suggestion, however it still renders in the 12hr format.


Rank: #170

try like this example:

TextToTime(FormatDateTime(CurrTime(),"HH:mm:ss"))

Rank: #1678

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?

Rank: #170
Rank: #1678
InputFormat.oml

Rank: #170

I only published and running (without update):

google Chrome

your app:


Rank: #170
Rank: #1678

Hmm, I sort of figured - so there's no way to enforce a particular format?


Thanks for all your help!

Rank: #170

Yes, you can try to do as Rui Barradas explained below.

Regards.

Rank: #94
Solution

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

Rank: #1678

Alright, we'll consider this. Thanks for your help everyone

Rank: #94

Sure thing Kristi :)

Glad that we helped you.


Kind regards,

Rui Barradas