|
Storing ColdFusion date object into a relational database?
I am trying to write an Auction website using HTML and ColdFusion powered by a relational database. It's an exercise/experiment that I've come up with.
ColdFusion has the Now() function that returns the current time on the server. I want to take that time, run it through the TimeFormat function and then store that in an SQL table field.
We are using MsSQL server and writing the queries in ColdFusion. I am programming the entire site using Visual Studio and will be managing the database using Visual Studio.
I don't know how I would store the formatted ColdFusion time object in the relational database. I need this information to determine when an auction has "expired".
I'm not sure how I could "actively" make this work.
For instance... if it reaches 5PM and the auction is set to 5PM technically the auction would be "over" but the buyer and seller would not know until another even happened. I don't know how to make the site "dynamic" in the fact that when the server time reaches 5 PM, something would happen that "ends" all the applicable auctions, creates an invoice for the buyer and notifies the seller that their item has sold and for how much.
That's further down the road though. For right now I need to figure out how to insert into a ColdFusion date/time object into my database table (hypothetically named "Auctions").
Unless there is a much better way to handle auctions "ending". I plan on allowing the user to select three different time spans for auctions (1 day, 3 day and 5 day) with the administrator having a "test" time span option of 60 seconds.
|