Re: Help w/Date Format from db
| From: | David Robley | Date: | Thu, 27 Jul 2000 04:25:41 +0000 |
| Subject: | Re: Help w/Date Format from db | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8472@lists.php.net to get a copy of this message | ||
On 26 Jul, Jack Sasportas wrote:
> Thanks for the fast response, but the result is all zeros...
> I basically did this:
>
> $tdate = explode('-',
> "mysql_result($result,$i,'received_date')");
> $tdate = sprintf("%d-%d-%d", $tdate[1], $tdate[2], $tdate[0]);
> echo $tdate;
>
> Again I am trying to format the date in the file to basically just have
> dd-mm-yy, by doing this it would be in standard format so to speak and also
> take 2 characters for the year instead of 4.
> Is this still the best way to do it ? or even the right way for what I'm trying
> to do ?
>
> Thanks
>
Have you looked at the date formatting functions that are available in
mysql? Alternatively, you could consider storing the date in seconds and
manipulating it with the php date functions.
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA