Dating system php
Dating system php - be happy today dating
This is because the Julian calendar (from which the Easter date is calculated) deviates from the Gregorian by one day for each century-year that is NOT a leap-year, i.e. (In the old Julian reckoning, EVERY 4th year was a leap-year.) This algorithm was first proposed by the mathematician/physicist Gauss.Its complexity derives from the fact that the calculation is based on a combination of solar and lunar calendars.
I couldn't find a simple way to do that in PHP, so I threw this together.When using dynamically generated date formatting string, be careful to generate the correct options for either PHP or My SQL.Most spreadsheet programs have a rather nice little built-in function called NETWORKDAYS to calculate the number of business days (i.e."skip all Fridays and Saturdays but include Sundays") or to set up dates that should always be skipped (e.g."skip July 4th in any year, skip the first Monday in September in any year"). It's common for us to overthink the complexity of date/time calculations and underthink the power and flexibility of PHP's built-in functions.The UNIX timestamp was built for this kind of work.
An example of this relates to a comment made by james at bandit-dot-co-dot-en-zed.The solution that I am using which I found on another site(so not taking credit) is to use this: date("Y/m/d H:i:s").substr((string)microtime(), 1, 6);that will give you: yyyy/mm/dd hh:ii:ss.uuuuuuhope this helps someone in need!It replicates the functionality of Open Office's NETWORKDAYS function - you give it a start date, an end date, and an array of any holidays you want skipped, and it'll tell you the number of business days (inclusive of the start and end days! I've tested it pretty strenuously but date arithmetic is complicated and there's always the possibility I missed something, so please feel free to check my math.The function could certainly be made much more powerful, to allow you to set different days to be ignored (e.g.The valid range of a timestamp is typically from Fri, GMT to Tue, GMT.