571
Views
14
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!

2020-05-07 18-53-00
Rui Barradas
 
MVP
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

2022-03-10 16-33-22
Kristi Kitz

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

2020-05-07 18-53-00
Rui Barradas
 
MVP

Sure thing Kristi :)

Glad that we helped you.


Kind regards,

Rui Barradas

2021-11-27 12-39-18
Josef Svenda

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.

2021-06-09 13-39-18
Agno Silveira
 
MVP

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
2022-03-10 16-33-22
Kristi Kitz

Hi Agno,

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


2021-06-09 13-39-18
Agno Silveira
 
MVP

try like this example:

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

2022-03-10 16-33-22
Kristi Kitz

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?

2021-06-09 13-39-18
Agno Silveira
 
MVP
2021-06-09 13-39-18
Agno Silveira
 
MVP

I only published and running (without update):

google Chrome

your app:


2021-06-09 13-39-18
Agno Silveira
 
MVP
2022-03-10 16-33-22
Kristi Kitz

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


Thanks for all your help!

2021-06-09 13-39-18
Agno Silveira
 
MVP

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

Regards.

2020-05-07 18-53-00
Rui Barradas
 
MVP
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

2022-03-10 16-33-22
Kristi Kitz

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

2020-05-07 18-53-00
Rui Barradas
 
MVP

Sure thing Kristi :)

Glad that we helped you.


Kind regards,

Rui Barradas

2021-11-27 12-39-18
Josef Svenda

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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.