aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsm/gsm0411_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gsm/gsm0411_utils.c')
-rw-r--r--src/gsm/gsm0411_utils.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c
index 0dd5ff84..0e87f515 100644
--- a/src/gsm/gsm0411_utils.c
+++ b/src/gsm/gsm0411_utils.c
@@ -150,11 +150,19 @@ time_t gsm340_scts(uint8_t *scts)
if (tz&0x08)
ofs_min = -ofs_min;
- /* Take into account timezone offset, timegm() can deal with
+ /* Take into account timezone offset from SCTS, timegm() can deal with
* values outside of the [0, 59] range */
tm.tm_min -= ofs_min;
-
+#ifdef HAVE_TIMEGM
timestamp = timegm(&tm);
+#else
+#warning gsm340_scts() without timegm() assumes that DST offset is one hour
+ tm.tm_isdst = 0;
+ timestamp = mktime(&tm);
+ timestamp += time_gmtoff(timestamp);
+ if (tm.tm_isdst)
+ timestamp -= 3600;
+#endif
if (timestamp < 0)
return -1;