[PATCH] Include minutes in SMS timezone field

Aleksander Morgado aleksander at aleksander.es
Thu Sep 19 07:45:30 UTC 2019


Hey,

> Comment in libmm-glib/mm-sms.c :mm_sms_get_timestamp() states that the time returned is ISO8601 complaint. However, ISO8601 mandates that year must be in YYYY format and not just YY. What we are showing in timestamp field is YYMMDDHHMMSS+ZZ. This is more in-line with the 7 octet timestamp received in SMS PDU and also shown using AT Command:
>
> AT+CMGR=1
> +CMGR: "REC UNREAD","+85291234567",,"07/02/18,00:05:10+32"
>
> OK
>
> Now, we cannot do YYYY as SMS PDU only has YY.
>

I don't think there will be many stored SMS from last century, so
let's assume that if we get only a 2-digit year value, we can prepend
"20" to that value to get the 4-digit year value.

> More important, you will notice in above AT command output that the timezone is "+32" which is actually "Quarters" and not "Hours" as MM is showing now
>
> So we've below ways to fix this:
>
> 1) change sms_decode_timestamp() to populate +ZZ as "quarters" and not "hours". This then becomes in-line with AT command reporting.
> 2) change format to YYMMDDHHMMSS+HHMM
>
> So what is the preference?
>

Let's do ISO8601 in long format (with field separators), which is
really readable, what do you think? e.g. 2019-09-19T09:45:00+0200

Cheers!

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list