diff --git a/hacks/sms-backup-iphone.pl b/hacks/sms-backup-iphone.pl
index 33c57c5c2..dabe9bbe6 100755
--- a/hacks/sms-backup-iphone.pl
+++ b/hacks/sms-backup-iphone.pl
@@ -241,16 +241,21 @@ sub sms_backup_1($$) {
# SMSes use normal Unix time_t, with epoch = Jan 1, 1970 GMT.
# iMessages use epoch = Jan 1, 2001 GMT. WTF!
#
# The "service" field is either 'iMessage' or 'SMS', but if it is set
# at all, then that means the date is of the other epoch.
#
$imsgp = 1 if defined ($h->{service});
my @lt = localtime($date);
print STDERR "$progname: IMPROBABLE YEAR: " . localtime($date) . "\n"
if ($lt[5] < (2005 - 1900) || $lt[5] > (localtime)[5]);
if ($subj && $text) { $text = "$subj\n$text"; }
elsif ($subj && !$text) { $text = $subj; }
index 33c57c5c2..dabe9bbe6 100755
--- a/hacks/sms-backup-iphone.pl
+++ b/hacks/sms-backup-iphone.pl
@@ -241,16 +241,21 @@ sub sms_backup_1($$) {
# SMSes use normal Unix time_t, with epoch = Jan 1, 1970 GMT.
# iMessages use epoch = Jan 1, 2001 GMT. WTF!
#
# The "service" field is either 'iMessage' or 'SMS', but if it is set
# at all, then that means the date is of the other epoch.
#
$imsgp = 1 if defined ($h->{service});
+
+ # Great news everybody! As of iOS 11, the date is now the number of
+ #milli nano! nanoseconds since the Satanic Anti-Epoch of Jan 1 2001:
+ $date /= 1000000000 if ($date > 100000000000000000);
+
$date += 978307200 if ($imsgp);+ # Great news everybody! As of iOS 11, the date is now the number of
+ #
+ $date /= 1000000000 if ($date > 100000000000000000);
+
my @lt = localtime($date);
print STDERR "$progname: IMPROBABLE YEAR: " . localtime($date) . "\n"
if ($lt[5] < (2005 - 1900) || $lt[5] > (localtime)[5]);
if ($subj && $text) { $text = "$subj\n$text"; }
elsif ($subj && !$text) { $text = $subj; }