New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMSD DeliveryReports: DeliveryDateTime does not include timezone #363

melones opened this Issue Oct 11, 2017 · 1 comment


None yet
2 participants

melones commented Oct 11, 2017

gammu-smsd: 1.38.5 (master)
cellular-op: different operators in PL

When a delivery report is received it is saved to DB with a datetimestamp without timezone. As a result I get a situation like DeliveryDateTime was received 2 hours before sending a message :)

ID | SendingDateTime | DeliveryDateTime | Status
4877 | 2017-10-11 13:36:12 | 2017-10-11 11:36:13 | DeliveryOK

I did a small research on this:
Default SQL takes the DeliveryDateTime value from SMSCTime:
UPDATE sentitems SET DeliveryDateTime = %C, Status = %1, StatusError = %e WHERE ID = %2 AND TPMR = %t

case 'C':
SMSDSQL_Time2String(Config, Fill_Time_T(sms->SMSCTime), static_buff, sizeof(static_buff));
to_print = static_buff;

And as I understand the SMSCTime should be adjusted in method Fill_Time_T() with timezone.

/* No time zone information */
timestruct.tm_gmtoff = now->tm_gmtoff;
timestruct.tm_zone = now->tm_zone;

However somehow it is not.
I thought that maybe during compilation timezone references in Fill_Time_T() are not added. But I checked the compilation log and it seems that everything was ok:

Performing C SOURCE FILE Test HAVE_STRUCT_TM_TM_ZONE succeeded with the following output:
Change Dir: /mnt/nand-user/temp/source/gammu-1.38.5/CMakeFiles/CMakeTmp

Database (Postgres) function now() returns correct time (including timezone). System timezone setting is also ok.

Am I wrong somewhere in my research? What could be the reason that the timezone is not taken into account?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.


This comment has been minimized.

Show comment
Hide comment

nijel Oct 16, 2017


Duplicate of #305


nijel commented Oct 16, 2017

Duplicate of #305

@nijel nijel marked this as a duplicate of #305 Oct 16, 2017

@nijel nijel closed this Oct 16, 2017

@nijel nijel added bug smsd labels Oct 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment