date and time problem
| From: | Kim Jacobs - MWEB | Date: | Fri, 14 May 2004 12:29:48 +0000 |
| Subject: | date and time problem | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-34429@lists.php.net to get a copy of this message | ||
> 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.