![]() ![]() Use the PHP DateTime class to calculate the difference between two date-times. Specifies an integer Unix timestamp.There are two ways to get the time difference in minutes with PHP.ġ. DATE_RFC3339 - Same as DATE_ATOM (since PHP 5.1.3).DATE_COOKIE - HTTP Cookies (example: Friday, 12-Apr-13 15:52:01 UTC).U - The seconds since the Unix Epoch (Janu00:00:00 GMT)Īnd the following predefined constants can also be used (available since PHP 5.1.0):.The offset for timezones west of UTC is negative (-43200 to 50400) T - Timezone abbreviations (Examples: EST, MDT).P - Difference to Greenwich time (GMT) in hours:minutes (added in PHP 5.1.3).O - Difference to Greenwich time (GMT) in hours (Example: +0100).I (capital i) - Whether the date is in daylights savings time (1 if Daylight Savings Time, 0 otherwise).e - The timezone identifier (Examples: UTC, GMT, Atlantic/Azores). ![]() s - Seconds, with leading zeros (00 to 59).i - Minutes with leading zeros (00 to 59).H - 24-hour format of an hour (00 to 23).h - 12-hour format of an hour (01 to 12).G - 24-hour format of an hour (0 to 23).g - 12-hour format of an hour (1 to 12).y - A two digit representation of a year.Y - A four digit representation of a year.L - Whether it's a leap year (1 if it is a leap year, 0 otherwise).t - The number of days in the given month.n - A numeric representation of a month, without leading zeros (1 to 12).M - A short textual representation of a month (three letters).m - A numeric representation of a month (from 01 to 12).F - A full textual representation of a month (January through December).W - The ISO-8601 week number of year (weeks starting on Monday).z - The day of the year (from 0 through 365).w - A numeric representation of the day (0 for Sunday, 6 for Saturday).S - The English ordinal suffix for the day of the month (2 characters st, nd, rd or th.N - The ISO-8601 numeric representation of a day (1 for Monday, 7 for Sunday).l (lowercase 'L') - A full textual representation of a day.j - The day of the month without leading zeros (1 to 31). ![]()
0 Comments
Leave a Reply. |