mbed

Fork of mbed-dev by mbed official

Revision:
177:447f873cad2f
Parent:
175:b96e65c34a4d
--- a/targets/TARGET_NUVOTON/TARGET_NANO100/rtc_api.c	Wed Oct 11 12:45:49 2017 +0100
+++ b/targets/TARGET_NUVOTON/TARGET_NANO100/rtc_api.c	Wed Oct 25 14:53:38 2017 +0100
@@ -87,6 +87,9 @@
     timeinfo.tm_mday = rtc_datetime.u32Day;
     timeinfo.tm_wday = rtc_datetime.u32DayOfWeek;
     timeinfo.tm_hour = rtc_datetime.u32Hour;
+    if (rtc_datetime.u32TimeScale == RTC_CLOCK_12 && rtc_datetime.u32AmPm == RTC_PM) {
+        timeinfo.tm_hour += 12;
+    }
     timeinfo.tm_min  = rtc_datetime.u32Minute;
     timeinfo.tm_sec  = rtc_datetime.u32Second;