diff -u gateway/gw/smsc_at2.c:1.1.1.1.2.30 gateway/gw/smsc_at2.c:1.1.1.1.2.37
--- gateway/gw/smsc_at2.c:1.1.1.1.2.30	Mon Jan 28 11:37:08 2002
+++ gateway/gw/smsc_at2.c	Thu Feb  7 18:58:00 2002
@@ -1161,17 +1364,23 @@
         /* DCS */
 	dcs = octstr_get_char(pdu, pos); 
         pos++;
         
         /* get the timestamp */
-        mtime.year   = octstr_get_char(pdu, pos) + 1900; pos++;
-        mtime.month  = octstr_get_char(pdu, pos); pos++;
-        mtime.day    = octstr_get_char(pdu, pos); pos++;
-        mtime.hour   = octstr_get_char(pdu, pos); pos++;
-        mtime.minute = octstr_get_char(pdu, pos); pos++;
-        mtime.second = octstr_get_char(pdu, pos); pos++;
+	mtime.year = ( ( octstr_get_char(pdu, pos) & 15 ) * 10 ) + ( octstr_get_char(pdu, pos) >> 4 ) ; pos++;
+	mtime.year += (mtime.year < 70 ? 2000 : 1900);
+	mtime.month  = ( ( octstr_get_char(pdu, pos) & 15 ) * 10 ) + ( octstr_get_char(pdu, pos) >> 4 ) ; pos++;
+	mtime.day = ( ( octstr_get_char(pdu, pos) & 15 ) * 10 ) + ( octstr_get_char(pdu, pos) >> 4 ); pos++;
+	mtime.hour = ( ( octstr_get_char(pdu, pos) & 15 ) * 10 ) + ( octstr_get_char(pdu, pos) >> 4 ); pos++;
+	mtime.minute  = ( ( octstr_get_char(pdu, pos) & 15 ) * 10 ) + ( octstr_get_char(pdu, pos) >> 4 ); pos++;
+	mtime.second  = ( ( octstr_get_char(pdu, pos) & 15 ) * 10 ) + ( octstr_get_char(pdu, pos) >> 4 ); pos++;
+
         /* time zone: */
         /* XXX handle negative time zones */
-        mtime.hour  += octstr_get_char(pdu, pos); pos++;
+        /* time zone is not "swapped nibble", with the MSB as the sign (1 is negative). the problem is that
+        +1 means that we have to substract 1 from the hour to get GMT. also remember that the time zone is measured
+        in quarters of the hour and not in full hours.
+        FIXME: we need to get the module of the division by 4 to the minute field */
+	mtime.hour += ((octstr_get_char(pdu, pos) >> 7) ? 1 : -1) * (octstr_get_char(pdu, pos) & 127) / 4; pos++;
         stime = date_convert_universal(&mtime);
         
         /* get data length */
