Re: US Date -> UK Date
| From: | David Robley | Date: | Thu, 19 Oct 2000 05:12:35 +0000 |
| Subject: | Re: US Date -> UK Date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21094@lists.php.net to get a copy of this message | ||
On Thu, 19 Oct 2000, James Crowley wrote:
> Hi,
> I am using MS SQL, which returns dates in the format yyyy-mm-dd. How do I
> then convert this to another format? (ie date("d m y",$datefield) ). If I
> attempt to convert it at the moment, it doesn't work.
>
> Thanks,
>
> - James
First up, if you want to send to the list by replying to a non-related
message, please trim the old message (in this case there were several
hundred lines of digest stuff!!)
Now, to your question. the date function expects a date in unix timestamp
format (seconds since 1 Jan 1970) which you aren't using. If you need to
just display the date without manipulating it once it has been extracted
from M$ $ql, use explode on the separator to place the d m and y parts in
an array, then just display the array elements in the desired order, with
your preferred separator.
Alternatively, you could muck around with mkdate...
And I'm sure there are several other ways - possibly including something in
M$ $ql?? But I know nothing about M$ $ql and plan to stay that way :-)
--
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