RTC component macro set for 12 hours does not work correctly

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
Mcolin
Posts: 11
http://meble-kuchenne.info.pl
Joined: Thu Aug 17, 2023 3:45 am

RTC component macro set for 12 hours does not work correctly

Post by Mcolin »

when I try to set the 24 hour value (rtc module default format) to 12 hour format.

specifically to change from 0:00 format to (12 hour format), which should be (12:00am), as shown below.

00:00 (24 hours format) = 12:00 am (12 hours format)

problema rtc.jpg
problema rtc.jpg (48.98 KiB) Viewed 143 times
Using the following logic schematic loaded into the microcontroller as shown below.
diagrama problema rtc.jpg
diagrama problema rtc.jpg (49.97 KiB) Viewed 143 times

After loading it into the microcontroller, the logic that follows is
wrong --> 0:00 (24 hours format) = 0:00 am (12 hours format)
correct --> 00:00 (24 hours format) = 12:00 am (12 hours format)
hora no cambia.jpg
hora no cambia.jpg (91.77 KiB) Viewed 143 times

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: RTC component macro set for 12 hours does not work correctly

Post by mnfisher »

There is a lot of discussion on this on the Web..

So 11:59 pm (23:59) goes to 0:00 (it's a new day) for both 12 and 24 hour formats.

Martin

Mcolin
Posts: 11
Joined: Thu Aug 17, 2023 3:45 am

Re: RTC component macro set for 12 hours does not work correctly

Post by Mcolin »

Hello Martin.

I know there are discussions on the Internet about this topic.
As an electronics designer, when I have a question about a format or even general design questions, I find it helpful to look for standardized references.
In the case of the 12-hour format, a useful reference is the successful smartphone industry.
Over years of using smartphones, I have never come across the unusual feature where the equivalent of 0 hours in 24-hour format is 0 hours in 12-hour format.
Thinking about an "easy-to use" philosophy for product design, my end client is accustomed to seeing that 0 hours (24h format) is equivalent to 12 hours (am).

I would like to avoid complaints because the customer sees a number that they are not accustomed to including in the time format they see daily.

However, i can program a separate format converter or add an if statement to change the value, making the macro function a little more confusing.

I attach a table with the equivalent values ​​between time formats.

12 Hours format - 24 Hours format
12:00 Am - 00:00
01:00 AM - 01:00
02:00 AM - 02:00
03:00 AM - 03:00
04:00 AM - 04:00
05:00 AM - 05:00
06:00 AM - 06:00
07:00 AM - 07:00
08:00 AM - 08:00
09:00 AM - 09:00
10:00 AM - 10:00
11:00 AM - 11:00

12:00 PM - 12:00
01:00 PM - 13:00
02:00 PM - 14:00
03:00 PM - 15:00
04:00 PM - 16:00
05:00 PM - 17:00
06:00 PM - 18:00
07:00 PM - 19:00
08:00 PM - 20:00
09:00 PM - 21:00
10:00 PM - 22:00
11:00 PM - 23:00

best regards.
Mcolin.

Post Reply