Klaas
|
| Posted: 09/16/2005, 4:34 AM |
|
Is there a possibility in CSS to imput dates like 00/00/2005? I know it is possible in MySQL but when I do it through a CSS generated PHP application the date is converted to 01/12/2005.
Thanx,
Klaas
|
|
|
 |
donb
Posts: 52
|
| Posted: 09/16/2005, 7:51 AM |
|
But why?
_________________
http://www.gotodon.com/ccbth |
 |
 |
Klaas
|
| Posted: 09/16/2005, 8:29 AM |
|
Quote donb:
But why?
My application handles data for which the exact date is not always known or will only be fully known at a later stage.
|
|
|
 |
DonB
|
| Posted: 09/16/2005, 9:58 AM |
|
I would not store them as a 'date' datatype, but as 'char(8)'. Really, I'd
be more radical, and store the day, month and year as separate integer
columns.
I dislike storing invalid data and doing what you propose creates issues
with data integrity and querying. One example would be "find all the rows
that haven't a complete date in them." You are forced into a query with
WHERE date like '0000%', which is going to be a table-scan (most likely) and
not based on an indexed-lookup.
A more appropriate, intuitive and efficient query would be WHERE month IS
NULL OR day IS NULL, thus my preference for separate columns.
But the direct answer is that the CCS date conversion routines are always
going to try to produce a valid date. What that turns out to be may well be
different for Windows vs. *nix web servers. So what you propose is not a
good idea, in several ways.
--
DonB
http://www.gotodon.com/ccbth
"Klaas" <Klaas@forum.codecharge> wrote in message
news:5432ae4dcb39ad@news.codecharge.com...
> Quote donb:
> But why?
>
>
> My application handles data for which the exact date is not always known
or
> will only be fully known at a later stage.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
Walter Kempees
|
| Posted: 09/17/2005, 4:02 AM |
|
I totally agree with DonB, not good practice.
If you must, and really really must, do this than take an out-of-sequence
date like for instance 1/1/1970 as a date, legal, correct and searchable.
"DonB" <~ccbth~@gotodon.com> schreef in bericht
news:dgetiq$qd0$1@news.codecharge.com...
>I would not store them as a 'date' datatype, but as 'char(8)'. Really, I'd
> be more radical, and store the day, month and year as separate integer
> columns.
>
> I dislike storing invalid data and doing what you propose creates issues
> with data integrity and querying. One example would be "find all the rows
> that haven't a complete date in them." You are forced into a query with
> WHERE date like '0000%', which is going to be a table-scan (most likely)
> and
> not based on an indexed-lookup.
>
> A more appropriate, intuitive and efficient query would be WHERE month IS
> NULL OR day IS NULL, thus my preference for separate columns.
>
> But the direct answer is that the CCS date conversion routines are always
> going to try to produce a valid date. What that turns out to be may well
> be
> different for Windows vs. *nix web servers. So what you propose is not a
> good idea, in several ways.
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "Klaas" <Klaas@forum.codecharge> wrote in message
>news:5432ae4dcb39ad@news.codecharge.com...
>> Quote donb:
>> But why?
>>
>>
>> My application handles data for which the exact date is not always known
> or
>> will only be fully known at a later stage.
>> ---------------------------------------
>> Sent from YesSoftware forum
>> http://forums.codecharge.com/
>>
>
>
|
|
|
 |
feha
Posts: 712
|
| Posted: 09/19/2005, 1:36 PM |
|
You an even store timestamp then convert it to any format in beforeshow event ...
_________________
Regards
feha
www.vision.to
feedpixel.com |
 |
 |
|