Merge branch 'collectd-4.10' into collectd-5.0
[collectd.git] / src / notify_email.c
index 6b4678a..cd216ca 100644 (file)
@@ -229,6 +229,7 @@ static int notify_email_notification (const notification_t *n,
     user_data_t __attribute__((unused)) *user_data)
 {
 
+  time_t tt;
   struct tm timestamp_tm;
   char timestamp_str[64];
 
@@ -248,7 +249,8 @@ static int notify_email_notification (const notification_t *n,
       (email_subject == NULL) ? DEFAULT_SMTP_SUBJECT : email_subject,
       severity, n->host);
 
-  localtime_r (&n->time, &timestamp_tm);
+  tt = CDTIME_T_TO_TIME_T (n->time);
+  localtime_r (&tt, &timestamp_tm);
   strftime (timestamp_str, sizeof (timestamp_str), "%Y-%m-%d %H:%M:%S",
       &timestamp_tm);
   timestamp_str[sizeof (timestamp_str) - 1] = '\0';