...

View Full Version : Date and Time ?



DjDanHayden
01-26-2012, 07:51 PM
$challenges=mysql_query("SELECT challid,challgrid,challgdid,challgrname,challgdname,DATE_FORMAT(created,'%M %d'),DATE_FORMAT(created,'%l:%i') FROM challenges WHERE challgrid='$team[id]' OR challgdid='$team[id]' ORDER BY created DESC");
while(list($challid,$challgrid,$challgdid,$challgrname,$challgdname,$created,$time)=mysql_fetch_row( $challenges))


I want the varaible $time to only show the time, it keeps outputting the date before it.

Can anyone help ?:confused:

Fou-Lu
01-26-2012, 09:09 PM
How are you printing it? DATE_FORMAT of %l:%i should just be 1:14 for example (you may want to add in an %p as well to tell if its AM or PM).

DjDanHayden
01-26-2012, 09:14 PM
How are you printing it? DATE_FORMAT of %l:%i should just be 1:14 for example (you may want to add in an %p as well to tell if its AM or PM).


This is what it prints: 2012-01-23 15:00:00


All i want is the time...

Fou-Lu
01-26-2012, 09:18 PM
yes, and I'm saying that the SQL doesn't appear to do that. What I mean is what code are you using to actually print this out?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum