Jump to content

Archived

This topic is now archived and is closed to further replies.

dunksy

Date manipulation

Recommended Posts

Good afternoon.

Right I am currently developing an availability and price checker for a hotel, and they want to be able to specify a price by date range. So they may enter a strt date, end date, and the price they wish to assign to all dates within that range.
Rather than store in a table a start date, end date and then price, i am thinking of storing one entry per day and store the price set. The reason being is that if they set the dates between June 1st 2006 and June 10th 2006 to price x, then go back, and set the dates between May 15th and June 15th there is going to be an overlap.

I therefore need to be able to take two dates and a price as input to my function, and the function would, for all dates occuring between these two, check the table to see if the entry is there for that specific date, and if not create one, if it is, then update it.

Sounds simple but I have still not got to grips with mktime() date() and the other date manipulation tools, and other tutorials do not seem to be helping me.

Any help would be greatly appreciated.

regards,

Duncan

Share this post


Link to post
Share on other sites
So what's the structure of your table? How are you storing the dates?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.