[php] datum

Gestart doorPropje27 reacties100 weergaven

28 berichten · pagina 1 van 2

Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo one2xserzz,
ik heb even een vraagje in mijn db roep ik dit op 2010-12-02 22:56:41

alleen ik wil dit 12 feb 2010 hebben alleen hoe doe ik dit ?
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]j M Y[/COLOR][COLOR= #007700],[/COLOR] strotime[COLOR= #007700]([/COLOR][COLOR= #0000BB]$datum_uit_db[/COLOR][COLOR= #007700]));[/COLOR]
?>
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@luukvdo

als ik dit doe

echo date(j M Y, strotime($lid->aangemeld));
?>

dan werkt het niet ?
0
Berichten
515
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]

[COLOR= #007700]function[/COLOR] NormalDate[COLOR= #007700]([/COLOR][COLOR= #0000BB]$date[/COLOR][COLOR= #007700]) {[/COLOR]

    [COLOR= #0000BB]$date[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]-[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$date[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]//dag, maand en jaar van elkaar af halen.[/COLOR]
    [COLOR= #0000BB]$time[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000] [/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$date[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700]]);[/COLOR] [COLOR= #FF8000]//Laatste waarde van $date zit de tijd bij in dus die er af halen[/COLOR]
    
    [COLOR= #0000BB]$date[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]-[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$date[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]-[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$date[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$time[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]];[/COLOR] [COLOR= #FF8000]//Alles in een nederlandse datum/tijd zetten.[/COLOR]
    [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$date[/COLOR][COLOR= #007700];
}[/COLOR]

[COLOR= #FF8000]//Even klein testje draaien.[/COLOR]
[COLOR= #0000BB]$date[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Y-m-d H:i:s[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] NormalDate[COLOR= #007700]([/COLOR][COLOR= #0000BB]$date[/COLOR][COLOR= #007700]);[/COLOR]



?>


je kan deze functie gebruiken als je wil..
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
justafool dan krijg ik dit te zien

->pmpm121Europe/Berlin12Europe/BerlinTuesday07-$Tuesday2207 2010-12-02 22:56:41

$date = date($lid->aangemeld);
echo NormalDate($date);
0
Berichten
515
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Propje schreef:
justafool dan krijg ik dit te zien

->pmpm121Europe/Berlin12Europe/BerlinTuesday07-$Tuesday2207 2010-12-02 22:56:41

$date = date($lid->aangemeld);
echo NormalDate($date);
probeer een echo NormalDate($lid->aangemeld);
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Propje schreef:
als ik dit doe

echo date(j M Y, strotime($lid->aangemeld));
?>

dan werkt het niet ?

Wat werkt er niet aan?
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan krijg ik dit wink
Fatal error: Call to undefined function strotime() in /home/propje/domains/tdpcc.nl/public_html/fifa/game/profiel.php on line 21
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]j M Y[/COLOR][COLOR= #007700],[/COLOR] [URL="http://www.php.net/strtotime"]strtotime[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$datum_uit_db[/COLOR][COLOR= #007700]));[/COLOR]
?>


En zo?
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan krijg ik dit yummie
1 Jan 1970 2010-12-02 22:56:41
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je moet die $datum_uit_db wel veranderen in je eigen tijd ding
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
alleen dat zit in me db

tabel leden
veld aangemeld

hoe moet ik dat doen dan ?
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]j M Y[/COLOR][COLOR= #007700],[/COLOR] [URL="http://www.php.net/strtotime"]strtotime[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lid[/COLOR][COLOR= #007700]->[/COLOR]aangemeld[COLOR= #007700]));[/COLOR]
?>


Zo?
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
alleen hij geeft dit weer. 2 Dec 2010 2010-12-02 22:56:41
alleen het moet zo 2 Dec 2010 22:56:41
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat heb je nu dan, want ligt wss aan jou nuwink
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