Mit dating form
James was looking for a way to calculate the number of days which have passed since a certain date.
Rather than using mktime() and a loop, James can subtract the current timestamp from the timestamp of the date in question and divide that by the number of seconds in a day: Another usage could find itself in a class submitted by Kyle M Hall which aids in the creation of timestamps from the recent past for use with My SQL.
thanks all In order to define leap year you must considre not only that year can be divide by 4!Rather than the looping and fine tuning of a date, Kyle can use the raw UNIX timestamps (this is untested code): The following function will return the date (on the Gregorian calendar) for Orthodox Easter (Pascha).Note that incorrect results will be returned for years less than 1601 or greater than 2399.Prior to PHP 5.6.23, Relative Formats for the start of the week aligned with PHP's (0=Sunday,6=Saturday).
Since 5.6.23, Relative Formats for the start of the week align with ISO-8601 (1=Monday,7=Sunday).in the "datetime" attribute you should put a machine-readable value which represent time , the best value is a full time/date with ISO 8601 ( date('c') ) ,,, the attr will be hidden from usersand it doesn't really matter what you put as a shown value to the user,, any date/time format is okay !This is very good for SEO especially search engines like Google .The correct alghoritm is:if (year is not divisible by 4) then (it is a common year)else if (year is not divisible by 100) then (it is a leap year)else if (year is not divisible by 400) then (it is a common year)else (it is a leap year)So the code should look like this:if($year%4 == 0 && $year0 !