date and time problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hi guys
> 
> I have a script which pulls a date(date default NULL) and a time (time default NULL) from a MySQL database, now I would like to display that date and time in a 'pretty' format.
> 
> I've been able to show the date nicely with the help of this:
> 
> 		$ntime=strtotime($row['date'] $row['time']);
> 		$ndate=date('D d F Y H:i',$ntime);
> 
> This shows the date in a 'nice' format (2004-05-10 20:40:00 is shown as Mon 10 May 2004 00:00), however, it shows the time as 00:00 for all of the games no matter what the time is. How do I get it to show the date as 20:40 or 20h40 or 8:40 PM?
> 
> If I change the lines to this:
> 		$ntime=strtotime("$row[date] $row[time] GMT");
> 		$ndate=date('D d F Y H:i',$ntime);
> the only difference is that it now shows Mon 10 May 2004 02:00 (probably because we are 2 hours ahead of GMT)
> 
> Any ideas please?
> 
> Thanks
> K
 
MWEB: S.A.'s most trusted and reliable Internet Service Provider. Just Like That. 

To join, go to: http://join.mweb.co.za or call 0860032000.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux