Jump to content

Creating a special date script


Eoin24

Recommended Posts

Hi!

 

I am a total newbie at this this and am trying to create a script where a user can enter in month/day/year beginning and a month/day/year end and have the script determine the day/month/year where a certain date will fall. I am thinking of this for school in particular where we might want to know what day the 100th day of school will be.

 

I am wondering if there are scripts that could help me get started on creating this or if someone would be able to tell me how I would start a script like this.

 

Thanks

Ian

 

Link to comment
https://forums.phpfreaks.com/topic/173276-creating-a-special-date-script/
Share on other sites

This is actually easy.. depending on how you prefer to do it..

 

Let's take the 100th day from a certain date (not 100th day of school, that's actually harder and depends on your local school board calendar... not everyone gets school off on all the same holidays).

 

$timestamp = strtotime("August 13th, 2009");
$timelater = strtotime("+100 days",$timestamp);

$timelater will be a timestamp referring to 100 days after August 13th, 2009. Perhaps this gives enough of a start?

 

Archived

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

×
×
  • 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.