Eoin24 Posted September 6, 2009 Share Posted September 6, 2009 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 More sharing options...
kratsg Posted September 6, 2009 Share Posted September 6, 2009 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? Link to comment https://forums.phpfreaks.com/topic/173276-creating-a-special-date-script/#findComment-913382 Share on other sites More sharing options...
Eoin24 Posted September 6, 2009 Author Share Posted September 6, 2009 Excellent! Thank you. Can a person using this script enter in their own starting date or does this script use a pre-determined date. Thanks again Ian Link to comment https://forums.phpfreaks.com/topic/173276-creating-a-special-date-script/#findComment-913409 Share on other sites More sharing options...
kratsg Posted September 6, 2009 Share Posted September 6, 2009 Any input in a function can be replaced by a variable of the proper type. In this case, I'm sure strtotime would prefer strings versus integers. :-P Link to comment https://forums.phpfreaks.com/topic/173276-creating-a-special-date-script/#findComment-913431 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.