PHP 还不错。
// given two timestamps: $t1, and $t2:
// find the number of days between two given dates, number of minutes
// between two given minute periods, etc.
$daysBetween = floor(($t2 - $t1) / 86400); // 86400 = 1 day in seconds
$hoursBetween = floor(($t2 - $t1) / 3600); // 3600 = 1 hour in seconds
// add and subtract intervals from timestamps
$newDate = $t1 + $interval;
// allow simple conversion between timezones, with Daylight Saving Time
// changes by region automatically accounted for (given that there's an
// accurate supporting database of regional settings available)
// See PHP's Calendar functions for that
// http://au2.php.net/manual/en/book.calendar.php
// It not only supports basic stuff like timezones and DST, but also
// different types of calendar: French, Julian, Gregorian and Jewish.
// get the period that a given timestamp falls into, given period
// granularity ("what calendar day is this date in?")
if (date("d", $t1) == 5) // check if the timestamp is the 5th of the month
if (date("h", $t1) == 16) // is it 4:00pm-4:59pm ?
// support very general string-to-date conversions (given a pattern)
// strtotime() is magic for this. you can just type in regular english
// and it figures it out. If your dates are stored in a particular format
// and you want to convert them, you can use strptime()
你必须给它一些荣誉,因为它有一个功能来告诉复活节在给定年份的日期。