Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
multiscan01 #1
Date format in CFMX "01-01-1970"
Hi,
I have a bit of a problem recognizing the dates read from an Ingres databse.
I am using Coldfusion MX7 and I run into the following scenarios:
a) - if the database value is NULL, the CF returns a non date value.
b) - if the databse value has been set to an empty string, CF returns
"1970-01-01"
Now, this can be dealt with and display the dates accordingly.
But what happens when a date is really set to a valid date of "1970-01-01"?
How would coldfusion check whether the database value is actually an empty
string or "1970-01-01"?
Anyone had this problem? Thanks.
multiscan01 Guest
-
#40717 [NEW]: date "01-01-1968" inaccessible via date function
From: manuel dot pinhao at nvisible dot pt Operating system: Windows XP SP2 PHP version: 5.2.1 PHP Bug Type: Date/time... -
#39106 [Opn->Bgs]: date("w") incompatible with date("W")
ID: 39106 Updated by: tony2001@php.net Reported By: felixmallek at gmx dot de -Status: Open +Status: ... -
#39106 [NEW]: date("w") incompatible with date("W")
From: felixmallek at gmx dot de Operating system: n/a PHP version: 5.1.6 PHP Bug Type: *Calendar problems Bug description: ... -
#24941 [Bgs]: strtotime returns same date for "first wednesday" and "second Wednesday"
ID: 24941 User updated by: jpage at javeo dot com Reported By: jpage at javeo dot com Status: Bogus Bug Type: ... -
#24941 [NEW]: strtotime returns same date for "first wednesday" and "second Wednesday"
From: jpage at javeo dot com Operating system: Red Hat Linux PHP version: 4.3.1 PHP Bug Type: Date/time related Bug... -
PaulH #2
Re: Date format in CFMX "01-01-1970"
i imagine it's the database that's doing this (or the driver). wouldn't it be
better to update the db to NULL for blanks (and fix whatever's causing this in
the first place)? or can you filter these rows maybe casting the empty date
columns to NULL? or do that and UNION it with non-NULL rows?
PaulH Guest
-
mpwoodward *TMM* #3
Re: Date format in CFMX "01-01-1970"
multiscan01 wrote:
Definitely wouldn't be CF just making this date up, so as Paul points> Hi,
>
> I have a bit of a problem recognizing the dates read from an Ingres databse.
> I am using Coldfusion MX7 and I run into the following scenarios:
> a) - if the database value is NULL, the CF returns a non date value.
> b) - if the databse value has been set to an empty string, CF returns
> "1970-01-01"
out it's the DB or the driver doing this. Here's a second vote for
making sure not to use 1-1-1970 as a "null" date. My car insurance
company was doing that until I came along, and since my birtdate
actually *is* 1/1/1970, they had to rework their system to accommodate
me. As a web developer I laughed really hard when they told me this was
the problem.
Always a bad idea to use an actual value as a "dummy" value,
particularly if it's a value that's a totally reasonable one. I'm not
so old yet that my birthdate should serve as such! ;-)
Matt
--
Matt Woodward
Team Macromedia - ColdFusion
mpwoodward *TMM* Guest
-
jorgepino #4
Re: Date format in CFMX "01-01-1970"
have to try to use single qoute in the insert or update query?
date = '#newdate#'
jorgepino Guest
-
jorgepino #5
Re: Date format in CFMX "01-01-1970"
also are you runing your site in a unix server if you are the 1970-01-01 i believe it is the default timestamps for unix machines
i hope it help
jorgepino Guest
-
multiscan01 #6
Re: Date format in CFMX "01-01-1970"
Thank you all for your time. Yes the database running on linux machine and as
Paul said I now believe it is the JDBC driver we are using. Yes, will go for
eliminating the source of the problem., clean the current empty strings values
and then interpreting the returned NULL values will be trivial. (thought I
could cut corners this time. Nope!)
Nice DOB Matt :-) ... as a web developer I am so frustrated when come accross
this kind of things.
multiscan01 Guest



Reply With Quote

