From a88b4670fe353f07095e66e17d2328324c13cb09 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Fri, 4 Dec 2015 22:32:45 +0100 Subject: Rechnet in franzi.php nun auch in Jahren. --- php/franzi.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/php/franzi.php b/php/franzi.php index fb95c2d..20093ea 100644 --- a/php/franzi.php +++ b/php/franzi.php @@ -6,11 +6,15 @@ $now=time(); $secs = $now - $time; +$years = (int) ($secs / 31536000); // == 1 jahr + +$secs = $secs - ($years * 31536000); + $now = date_create('now', new DateTimeZone('GMT')); $here = clone $now; $here->modify($secs.' seconds'); $diff = $now->diff($here); -$body = $diff->format('Wir sind %a Tage, %h Stunde, %i Minuten und %s Sekunden zusammen.'); -mail("fnetzband@googlemail.com", "Timestamp duration relationship", $body, "From: Liebling \r\n"); +$body = $diff->format('Wir sind '.$years.' Jahr, %a Tage, %h Stunde, %i Minuten und %s Sekunden zusammen.'); +mail("fnetzband@iamfabulous.de", "Timestamp duration relationship", $body, "From: Liebling \r\n"); -- cgit v1.2.3