My own solution to this is a bit more complex but it seems to work with both of the 
databases I work with. MySQL and Postgress.

for example I would use 'select *,unix_timestamp(cr_date) as my_cr_date from table 
where ref_index=2345;'

Then when I go to output it I can use the unix date command such as 

'$string=date("l dS of F Y h:i:s A",db->f(my_cr_date));

My reference to db->f(my_cr_date) is my phplib methof of reading the data. You may use 
your own method. Doing it this way you can get your own method of displaying dates or 
times in almost any way you want. And you don;t have to count on your database 
supporting it.

>>> "Mark Roedel" <[EMAIL PROTECTED]> 03/07/01 09:08AM >>>
> -----Original Message-----
> From: Matt Davis [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, March 07, 2001 7:35 AM
> To: Php Mailing List
> Subject: [PHP] dates from db
> 
> 
> I am calling on a number of fields from my db one of which is 
> a date. When the date displays it is in the following format
> 
> YYYY-MM-DD 00:00:00
> 
> I Want it to only display the date and not the time like this
>
> YYYY-MM-DD
> 
> Is it possible to remove the time when calling on it from the db

Check the documentation for the database engine you're using.

MySQL, for example, has a date_format() function that you can use in
your query to specify what information you'd like displayed from a
date/time field, and how you'd like it presented.


---
Mark Roedel ([EMAIL PROTECTED])  ||  "There cannot be a crisis next week.
Systems Programmer / WebMaster  ||   My schedule is already full."
     LeTourneau University      ||                    -- Henry Kissinger


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 
To contact the list administrators, e-mail: [EMAIL PROTECTED] 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to