Jump to content

Date manipulation


dunksy

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.