JavaScript/PHP tellen vanaf

Gestart doorMilan18 reacties30 weergaven

19 berichten · pagina 2 van 2

Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Pff waarom heeft php daar geen functie voornopompom
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$datum_oud[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mktime"]mktime[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]17[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]12[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]7[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]2010[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$datum_nu[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/time"]time[/URL][COLOR= #007700]();[/COLOR]
    
[COLOR= #0000BB]$uitkomst[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$datum_nu[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]$datum_oud[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #0000BB]$dagen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uitkomst[/COLOR] / [COLOR= #007700]([/COLOR][COLOR= #0000BB]24[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]60[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]60[/COLOR][COLOR= #007700]));[/COLOR]
[COLOR= #0000BB]$uitkomst[/COLOR] [COLOR= #007700]-=[/COLOR] [COLOR= #0000BB]$dagen[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]24[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]60[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]60[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #0000BB]$uren[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uitkomst[/COLOR] / [COLOR= #007700]([/COLOR][COLOR= #0000BB]60[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]60[/COLOR][COLOR= #007700]));[/COLOR]
[COLOR= #0000BB]$uitkomst[/COLOR] [COLOR= #007700]-=[/COLOR] [COLOR= #0000BB]$uren[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]60[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]60[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #0000BB]$minuten[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uitkomst[/COLOR] / [COLOR= #0000BB]60[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$uitkomst[/COLOR] [COLOR= #007700]-=[/COLOR] [COLOR= #0000BB]$minuten[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]60[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$dagen[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] dagen, [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$uren[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] uren, [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$minuten[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] minuten en [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$uitkomst[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] seconden[/COLOR][COLOR= #007700];[/COLOR]
?>


Alsje.

In maanden weergeven moet je niet willen, want wat is een maand? 30 dagen? 31 dagen? vier weken? 365/12 dagen?

edit:
kan wel met deze functie: biggrinhttp://www.php.net/manual/en/datetime.diff.php
0
Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik snap de ballen van de functie,

Maar hij werkt nu goed dankzij ut script van Lennard
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Laat me dit maar ook opslaan voor dat ik het ook nodig heb. emo
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren