Page 1 of 1
					
				RTC component macro set for 12 hours does not work correctly
				Posted: Sun Feb 18, 2024 6:07 am
				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 (48.98 KiB) Viewed 2382 times
 
		
		
		
			 
           Using the following logic schematic loaded into the microcontroller as shown below.
			
		
				
			
 
						- diagrama problema rtc.jpg (49.97 KiB) Viewed 2382 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 (91.77 KiB) Viewed 2382 times
 
		
		
		
			  
			 
			
					
				Re: RTC component macro set for 12 hours does not work correctly
				Posted: Sun Feb 18, 2024 10:33 am
				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
			 
			
					
				Re: RTC component macro set for 12 hours does not work correctly
				Posted: Sun Feb 18, 2024 11:39 pm
				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.