Jump to content

How to calculate the entries within the last 40 business days?


TheBrandon

Recommended Posts

Hello all,

 

I have a typical registration system where users can create accounts and the current time is stored in a TIMESTAMP field.

 

I need to calculate how many people joined with the last 40 business days.

 

What is the best way to achieve this? I found a few functions on php.net for calculating business days but all of the ones I found seem to deal primarily with the future, not the past.

 

I really just need the single date. If I could just get a function that would return a 2012-05-24 21:11:49 type timestamp for the date 40 business days ago, I think I could take it from there, I'm just not sure what the most efficient way to calculate this is.

 

Any ideas?

Link to comment
Share on other sites

Excluding holidays, 40 business days = 8 whole weeks. It's a rather convenient number. So no special logic required.

 

Wow, I didn't realize that lol. Thank you very much. Sometimes I guess you just need another mind looking at the problem!

 

Have a great day, thanks again!

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.