summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-12-05 12:15:51 -0600
committerDan Williams <dcbw@redhat.com>2012-12-05 12:15:51 -0600
commit4e980d17396bc65acd49edbaf195013dcae5e5d0 (patch)
tree877b13ebb70bd444fb21ee5b4cbda556e6a54b92
parentdd51f7a6aeb5b133dad32918c73c3e7583a96d97 (diff)
icera: report 4-digit year as required by ISO-8601
Assume 2000 + year.
-rw-r--r--plugins/icera/mm-broadband-modem-icera.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/icera/mm-broadband-modem-icera.c b/plugins/icera/mm-broadband-modem-icera.c
index e613f84c..153356f7 100644
--- a/plugins/icera/mm-broadband-modem-icera.c
+++ b/plugins/icera/mm-broadband-modem-icera.c
@@ -1445,9 +1445,15 @@ parse_tlts_query_reply (const gchar *response,
1445 } 1445 }
1446 1446
1447 if (iso8601) { 1447 if (iso8601) {
1448 /* Icera modems only report a 2-digit year, while ISO-8601 requires
1449 * a 4-digit year. Assume 2000.
1450 */
1451 if (year < 100)
1452 year += 2000;
1453
1448 /* don't give tz info in the date/time string, we have another 1454 /* don't give tz info in the date/time string, we have another
1449 * property for that */ 1455 * property for that */
1450 *iso8601 = g_strdup_printf ("%02d/%02d/%02d %02d:%02d:%02d", 1456 *iso8601 = g_strdup_printf ("%04d/%02d/%02d %02d:%02d:%02d",
1451 year, month, day, 1457 year, month, day,
1452 hour, minute, second); 1458 hour, minute, second);
1453 } 1459 }