Re: [PATCH] SMPP validity
Vibhu Mohindra <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
> Ok. then get the timezone from the locale using localtime() and the global variable timezone. Right. Here it is then. Thanks Oded. Vibhu
tmp12
(text/plain, 873 B)
--- gateway.orig/gw/smsc/smsc_smpp.c Thu Aug 22 01:11:29 2002
+++ gateway/gw/smsc/smsc_smpp.c Fri Aug 23 06:51:09 2002
@@ -258,7 +258,7 @@
SMPP_PDU *pdu;
Octstr *buffer;
Octstr *relation_UTC_time = NULL;
- struct tm gmtime, localtime, tm;
+ struct tm tm;
int gwqdiff;
pdu = smpp_pdu_create(submit_sm,
@@ -359,11 +359,8 @@
if (msg->sms.validity || msg->sms.deferred) {
/* work out 1/4 hour difference between local time and UTC/GMT */
- gmtime = gw_gmtime(time(NULL));
- localtime = gw_localtime(time(NULL));
- gwqdiff = ((localtime.tm_hour - gmtime.tm_hour) * 4)
- + ((localtime.tm_min - gmtime.tm_min) / 15);
-
+ gw_localtime(time(NULL));
+ gwqdiff = (int) (-timezone/900);
if (gwqdiff >= 0) {
relation_UTC_time = octstr_create("+");
} else {
signature.asc
(application/pgp-signature, 232 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9ZYfsvgqsqbNQjqcRAkCsAJ4/7u4wEMvoesRkdcq5Oay02az0nwCaA4te /uRdA1BOkRSLvnB37ddVsWs= =QmWn -----END PGP SIGNATURE-----