Hi,

Pete Ruckelshaus wrote:
> I'm stuck.  Could be just because it's late, but I'm not getting anywhere.
> 
> I'm writing a scheduling application to make my wife's life a bit
> easier.  One of the tables will contain standard shift times for
> employees, i.e. 7:30-16:00, 8:30-17:00.  I use these values to
> populate a dropdown that a person's shift can be selected from.
>........ 
> The administrator then enters shift start/end times in HH24:mm format
> 
> The problem I am having is on inserting those values into the
> database.  If I try to insert the value as <cfqueryparam
> cfsqltype="CF_SQL_DATE" value="#timeFormat(FORM.timestart)#">  With
> debug output turned on, I can see that the value being inserted is {ts
> '1899-12-30 16:00:00'}, which is correct (remember, I don't care about
> the date, just the time).
> 
> However, viewing the actual data in the database, that value is being
> stored as 12/30/1899 12:00:00 PM
> 
> Anyone have a clue as to why the value being inserted is correct, but
> the value being actually stored isn't?  

The chances are that the value stored is correct.

I do not know which database you are using and how you are viewing it 
but virtually all of them store the data as a DateTime object of some 
form internally so that they can do date manipulations easily, they do 
not use text strings or anything like that. To make it easier for humans 
the dates and times displayed in a viewing device, be it Enterprise 
Manager or looking at it "directly" in Access, is usually formatted and 
how that formatting is done varies greatly. If you are lucky the date 
get formatted according to the locale set on the server/workstation and 
it makes sense to you, otherwise you have to translate but rest assured 
that what you see on the screen is not what is "inside".

HTH,


Kym K

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219820
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to