Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-26-2012, 07:51 PM   PM User | #1
DjDanHayden
New Coder

 
DjDanHayden's Avatar
 
Join Date: Nov 2008
Location: Ireland
Posts: 43
Thanks: 16
Thanked 0 Times in 0 Posts
DjDanHayden is an unknown quantity at this point
Date and Time ?

PHP Code:
$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 ?
DjDanHayden is offline   Reply With Quote
Old 01-26-2012, 09:09 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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).
Fou-Lu is offline   Reply With Quote
Old 01-26-2012, 09:14 PM   PM User | #3
DjDanHayden
New Coder

 
DjDanHayden's Avatar
 
Join Date: Nov 2008
Location: Ireland
Posts: 43
Thanks: 16
Thanked 0 Times in 0 Posts
DjDanHayden is an unknown quantity at this point
Quote:
Originally Posted by Fou-Lu View Post
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...
DjDanHayden is offline   Reply With Quote
Old 01-26-2012, 09:18 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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?
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:39 AM.


Advertisement
Log in to turn off these ads.