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
> -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
If it's stored as a unix timestamp you can format it any way you like.
[www.php.net/date]
If it's stored as a string in the -MM-DD hh:mm:ss format, you can use
substr(0,10) [www.php.net/substr] to get the first 10 characters and only
display those.
HTH
Jon
-Original Message-
From:
3 matches
Mail list logo