Re: [PhP - dB] About Formatting a Date Result
- From: "almostbob" <anonymous1@xxxxxxxxxxxxx>
- Date: Thu, 29 Jan 2009 14:58:14 GMT
you have to correctt the way the data is entered into your table so that it
is not a formatted string
and do an update on the table to alter the stored data to a timestamp with
the same value
--
_ _
"Moose" <1911@xxxxxxxxxxx> wrote in message
news:280120090647118269%1911@xxxxxxxxxxxxxx
Hi almostbob, thanks for the input.
In the MySQL database the field is set to date not timestamp as you
stated. I did change the field to timestamp but now my output is
exactly date(j-m-Y, %s), which displays as:
date(j-m-Y,1999-01-01 00:00:00
Now What?
Thanks
Mike
In article <jR%el.7669$Db2.1059@edtnps83>, almostbob
<anonymous1@xxxxxxxxxxxxx> wrote:
what you are getting is an unformatted string, directly out of the
database
in the sql query that creates the table row it appears some severe lack
of
foresight has stored a string date instead of a timestamp,
if the timestamp were stored then date comparison is easier, select a
range
of dates by simply numeric values,
output is easier, can be formatted to different user requirements even
while
the information is displayed
the database is slightly smaller and faster, int compared to a text
field.
and can format your date to that used, in the config files, for any user
redesign the database and the sql input at this early stage and less
problems later,
the output field can then be
<td>date(j-m-Y, %s)</td>
I have chosen 31d-12m-1999y, thats the way my calendar works, the date
strings are in the php online manual.
.
- References:
- Re: [PhP - dB] About Formatting a Date Result
- From: almostbob
- Re: [PhP - dB] About Formatting a Date Result
- Prev by Date: Re: [PHP] Rounded rectangle in php
- Next by Date: Re: [PHP] Making a Variable from different tables with Matching Dbfields?
- Previous by thread: Re: [PhP - dB] About Formatting a Date Result
- Next by thread: Accessing binary email attachment via PHP
- Index(es):
Relevant Pages
|