Jump to content


Photo

[SOLVED] Displaying time from a database?! *solved*


  • Please log in to reply
No replies to this topic

#1 coalduststar

coalduststar
  • Members
  • PipPipPip
  • Advanced Member
  • 47 posts
  • LocationNorthern Ireland

Posted 03 October 2006 - 01:14 PM

Hi - I have an SQL database with separate fields for time and date stored as time and date datatypes.

when I'm pullilng these values out of the database I want to format the date to: dd-mm-yyyy and I want the time to read without the seconds in 12 hour format: hh:ii am/pm.

I can get the current time displayed easily enough but I can't seem to be able to format a stored time:

        <?php $cream = $row_rsEventsByDate['ev_time']; 
		  echo $cream = date('g:i a');
	?>

**it's ok I did some extensive looking through all the stuff on the forum and found an article eventually thanks!**
There is no nobility in being superior to your fellow man- true nobility comes from being superior to your former self.

go on give us a listen!
www.jackalfeud.bandcamp.com
www.soundcloud.com/jackalfeud




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users