{"id":15578323,"url":"https://github.com/elusivecodes/fyredatetime","last_synced_at":"2026-02-25T06:45:17.825Z","repository":{"id":62508432,"uuid":"374353159","full_name":"elusivecodes/FyreDateTime","owner":"elusivecodes","description":"FyreDateTime is a free, open-source date manipulation library for PHP.","archived":false,"fork":false,"pushed_at":"2024-10-30T10:53:17.000Z","size":248,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T13:38:25.746Z","etag":null,"topics":["date","datetime","format","icu","locale","localization","parse","php","time","timezone"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elusivecodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-06T12:20:32.000Z","updated_at":"2024-10-30T10:52:54.000Z","dependencies_parsed_at":"2024-06-27T04:04:58.914Z","dependency_job_id":"67dd2681-7647-45a3-8fa3-0e1fd81f8b9f","html_url":"https://github.com/elusivecodes/FyreDateTime","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":0.3870967741935484,"last_synced_commit":"ca8f9530fc4218b45cb36f104f31174926799686"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreDateTime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreDateTime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreDateTime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreDateTime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elusivecodes","download_url":"https://codeload.github.com/elusivecodes/FyreDateTime/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250540941,"owners_count":21447427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date","datetime","format","icu","locale","localization","parse","php","time","timezone"],"created_at":"2024-10-02T19:08:49.477Z","updated_at":"2025-10-29T11:41:49.254Z","avatar_url":"https://github.com/elusivecodes.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FyreDateTime\r\n\r\n**FyreDateTime** is a free, open-source immutable date manipulation library for *PHP*.\r\n\r\nIt is a modern library, and features support for ICU formats, time zones and locales.\r\n\r\n\r\n## Table Of Contents\r\n- [Installation](#installation)\r\n- [Basic Usage](#basic-usage)\r\n- [Date Creation](#date-creation)\r\n- [Date Formatting](#date-formatting)\r\n- [Date Attributes](#date-attributes)\r\n- [Week Attributes](#week-attributes)\r\n- [Time Attributes](#time-attributes)\r\n- [Timestamps](#timestamps)\r\n- [Time Zones](#time-zones)\r\n- [Locales](#locales)\r\n- [Manipulation](#manipulation)\r\n- [Comparisons](#comparisons)\r\n- [Utility Methods](#utility-methods)\r\n- [Static Methods](#static-methods)\r\n\r\n\r\n\r\n## Installation\r\n\r\n**Using Composer**\r\n\r\n```\r\ncomposer require fyre/datetime\r\n```\r\n\r\nIn PHP:\r\n\r\n```php\r\nuse Fyre\\DateTime\\DateTime;\r\n```\r\n\r\n\r\n## Basic Usage\r\n\r\n- `$dateString` is a string representing the date, and will default to the current timestamp.\r\n- `$timeZone` is a string representing the time zone of the date, and will default to the system time zone.\r\n- `$locale` is a string representing the locale of the date, and will default to the system locale.\r\n\r\n```php\r\n$dateTime = new DateTime($dateString, $timeZone, $locale);\r\n```\r\n\r\n\r\n## Date Creation\r\n\r\n**Create From Array**\r\n\r\n- `$dateArray` is an array containing the year, month, date, hours, minutes, seconds and milliseconds.\r\n- `$timeZone` is a string representing the time zone of the date, and will default to the system time zone.\r\n- `$locale` is a string representing the locale of the date, and will default to the system locale.\r\n\r\n```php\r\n$dateTime = DateTime::createFromArray($dateArray, $timeZone, $locale);\r\n```\r\n\r\nThe month and date in the `$dateArray` will default to 1 if not set. The hours, minutes, seconds and milliseconds will default to 0.\r\n\r\n**Create From Format**\r\n\r\n- `$formatString` is a string containing the format you wish to use for parsing.\r\n- `$dateString` is a string representing the date you are parsing.\r\n- `$timeZone` is a string representing the time zone of the date, and will default to the system time zone.\r\n- `$locale` is a string representing the locale of the date, and will default to the system locale.\r\n\r\nThe `$formatString` supports tokens described in the [ICU specification](https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax).\r\n\r\n```php\r\n$dateTime = DateTime::createFromFormat($formatString, $dateString, $timeZone, $locale);\r\n```\r\n\r\n**Create From Iso String**\r\n\r\n- `$dateString` is a string representing the date you are parsing.\r\n- `$timeZone` is a string representing the time zone of the date, and will default to the system time zone.\r\n- `$locale` is a string representing the locale of the date, and will default to the system locale.\r\n\r\n```php\r\n$dateTime = DateTime::createFromIsoString($dateString, $timeZone, $locale);\r\n```\r\n\r\n**Create From Native DateTime**\r\n\r\n- `$dateTime` is an instance of a class implementing *DateTimeInterface*.\r\n- `$timeZone` is a string representing the time zone of the date, and will default to the system time zone.\r\n- `$locale` is a string representing the locale of the date, and will default to the system locale.\r\n\r\n```php\r\n$newDateTime = DateTime::createFromNativeDateTime($dateTime, $timeZone, $locale);\r\n```\r\n\r\n**Create From Timestamp**\r\n\r\n- `$timestamp` is the number of seconds since the UNIX epoch.\r\n- `$timeZone` is a string representing the time zone of the date, and will default to the system time zone.\r\n- `$locale` is a string representing the locale of the date, and will default to the system locale.\r\n\r\n```php\r\n$dateTime = DateTime::createFromTimestamp($timestamp, $timeZone, $locale);\r\n```\r\n\r\n**Now**\r\n\r\n- `$timeZone` is a string representing the time zone of the date, and will default to the system time zone.\r\n- `$locale` is a string representing the locale of the date, and will default to the system locale.\r\n\r\n```php\r\n$dateTime = DateTime::now($timeZone, $locale);\r\n```\r\n\r\n\r\n## Date Formatting\r\n\r\n**Format**\r\n\r\nOnce you have created a *DateTime* object, you can get a string representation using a specific format with the `format` method.\r\n\r\n- `$formatString` is a string containing the format you wish to output using.\r\n\r\nThe `$formatString` supports tokens described in the [ICU specification](https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax).\r\n\r\n```php\r\n$dateString = $dateTime-\u003eformat($formatString);\r\n```\r\n\r\n**To String**\r\n\r\nFormat the current date using \"*eee MMM dd yyyy HH:mm:ss xx (VV)*\".\r\n\r\n```php\r\n$string = $dateTime-\u003etoString();\r\n```\r\n\r\n**To Date String**\r\n\r\nFormat the current date using \"*eee MMM dd yyyy*\".\r\n\r\n```php\r\n$dateString = $dateTime-\u003etoDateString();\r\n```\r\n\r\n**To Iso String**\r\n\r\nFormat the current date using \"*yyyy-MM-dd'T'HH:mm:ss.SSSxxx*\" (in English and UTC time zone).\r\n\r\n```php\r\n$isoString = $dateTime-\u003etoIsoString();\r\n```\r\n\r\n**To Native DateTime**\r\n\r\nConvert the object to a native *DateTime*.\r\n\r\n```php\r\n$nativeDateTime = $dateTime-\u003etoNativeDateTime();\r\n```\r\n\r\n**To Time String**\r\n\r\nFormat the current date using \"*HH:mm:ss xx (VV)*\".\r\n\r\n```php\r\n$timeString = $dateTime-\u003etoTimeString();\r\n```\r\n\r\n**To UTC String**\r\n\r\nFormat the current date using \"*eee MMM dd yyyy HH:mm:ss xx (VV)*\" (in UTC time zone).\r\n\r\n```php\r\n$utcString = $dateTime-\u003etoUTCString();\r\n```\r\n\r\n\r\n## Date Attributes\r\n\r\n**Get Date**\r\n\r\nGet the date in current time zone.\r\n\r\n```php\r\n$date = $dateTime-\u003egetDate();\r\n```\r\n\r\n**Get Day**\r\n\r\nGet the day of the week in current time zone.\r\n\r\nThe `$day` returned will be between *0* (Sunday) and *6* (Saturday).\r\n\r\n```php\r\n$day = $dateTime-\u003egetDay();\r\n```\r\n\r\n**Get Day Of Year**\r\n\r\nGet the day of the year in current time zone.\r\n\r\nThe `$dayOfYear` returned will be between *0* and *365*.\r\n\r\n```php\r\n$dayOfYear = $dateTime-\u003egetDayOfYear();\r\n```\r\n\r\n**Get Month**\r\n\r\nGet the month in current time zone.\r\n\r\nThe `$month` returned will be between *1* (January) and *12* (December).\r\n\r\n```php\r\n$month = $dateTime-\u003egetMonth();\r\n```\r\n\r\n**Get Quarter**\r\n\r\nGet the quarter of the year in current time zone.\r\n\r\nThe `$quarter` returned will be between *1* and *4*.\r\n\r\n```php\r\n$quarter = $dateTime-\u003egetQuarter();\r\n```\r\n\r\n**Get Year**\r\n\r\nGet the year in current time zone.\r\n\r\n```php\r\n$year = $dateTime-\u003egetYear();\r\n```\r\n\r\n**With Date**\r\n\r\nClone the *DateTime* with a new date in current time zone.\r\n\r\n- `$date` is a number representing the date.\r\n\r\n```php\r\n$newDate = $dateTime-\u003ewithDate($date);\r\n```\r\n\r\n**With Day**\r\n\r\nClone the *DateTime* with a new day of the week in current time zone.\r\n\r\n- `$day` is a number representing the day of the week (between *0* and *6*).\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithDay($day);\r\n```\r\n\r\n**With Day Of Year**\r\n\r\nClone the *DateTime* with a new day of the year in current time zone.\r\n\r\n- `$dayOfYear` is a number representing the day of the year (between *0* and *365*).\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithDayOfYear($dayOfYear);\r\n```\r\n\r\n**With Month**\r\n\r\nClone the *DateTime* with a new month in current time zone.\r\n\r\n- `$month` is a number representing the month (between *1* and *12*).\r\n- `$date` is a number representing the date, and will default to the current value.\r\n\r\nIf the `$date` argument is omitted, and the new month contains less days than the current date, the date will be set to the last day of the new month.\r\n\r\nTo disable date clamping, use the method `DateTime::setDateClamping()` using *false* as the argument.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithMonth($month, $date);\r\n```\r\n\r\n**With Quarter**\r\n\r\nClone the *DateTime* with a new quarter of the year in current time zone.\r\n\r\n- `$quarter` is a number representing the quarter between *1* and *4*.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithQuarter($quarter);\r\n```\r\n\r\n**With Year**\r\n\r\nClone the *DateTime* with a new year in current time zone.\r\n\r\n- `$year` is a number representing the year.\r\n- `$month` is a number representing the month (between *1* and *12*), and will default to the current value.\r\n- `$date` is a number representing the date, and will default to the current value.\r\n\r\nIf the `$date` argument is omitted, and the new month contains less days than the current date, the date will be set to the last day of the new month.\r\n\r\nTo disable date clamping, use the method `DateTime::setDateClamping()` using *false* as the argument.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithYear($year, $month, $date);\r\n```\r\n\r\n\r\n## Week Attributes\r\n\r\n**Get Week**\r\n\r\nGet the week of the year in current time zone.\r\n\r\nThe `$week` returned will be between *1*  and *53* (week starting on Monday).\r\n\r\n```php\r\n$week = $dateTime-\u003egetWeek();\r\n```\r\n\r\n**Get Week Day**\r\n\r\nGet the local day of the week in current time zone.\r\n\r\nThe `$weekDay` returned will be between *1* and *7*.\r\n\r\n```php\r\n$weekDay = $dateTime-\u003egetWeekDay();\r\n```\r\n\r\n**Get Week Day In Month**\r\n\r\nGet the day of the week in the month, in current time zone.\r\n\r\nThe `$weekDayInMonth` returned will be between *1* and *5*.\r\n\r\n```php\r\n$weekDayInMonth = $dateTime-\u003egetWeekDayInMonth();\r\n```\r\n\r\n**Get Week Of Month**\r\n\r\nGet the week of the month in current time zone.\r\n\r\nThe `$weekOfMonth` returned will be between *1*  and *5*.\r\n\r\n```php\r\n$weekOfMonth = $dateTime-\u003egetWeekOfMonth();\r\n```\r\n\r\n**Get Week Year**\r\n\r\nGet the week year in current time zone.\r\n\r\nThis method is identical to `getYear()` except in cases where the week belongs to the previous or next year, then that value will be used instead.\r\n\r\n```php\r\n$weekYear = $dateTime-\u003egetWeekYear();\r\n```\r\n\r\n**With Week**\r\n\r\nClone the *DateTime* with a new week in current time zone.\r\n\r\n- `$week` is a number representing the week.\r\n- `$weekDay` is a number representing the day (between *1* and *7*), and will default to the current value.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithWeek($week, $weekDay);\r\n```\r\n\r\n**With Week Day**\r\n\r\nClone the *DateTime* with a new local day of the week in current time zone.\r\n\r\n- `$weekDay` is a number representing the week day (between *1* and *7*).\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithWeekDay($weekDay);\r\n```\r\n\r\n**With Week Day In Month**\r\n\r\nClone the *DateTime* with a new day of the week in the month, in current time zone.\r\n\r\n- `$weekDayInMonth` is a number representing the day of the week in month (between *1* and *5*).\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithWeekDayInMonth($weekDayInMonth);\r\n```\r\n\r\n**With Week Of Month**\r\n\r\nClone the *DateTime* with a new week of the month in current time zone.\r\n\r\n- `$weekOfMonth` is a number representing the week of the month (between *1*  and *5*).\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithWeekOfMonth($weekOfMonth);\r\n```\r\n\r\n**With Week Year**\r\n\r\nClone the *DateTime* with a new week year in current time zone.\r\n\r\n- `$weekYear` is a number representing the year.\r\n- `$week` is a number representing the week, and will default to the current value.\r\n- `$weekDay` is a number representing the day (between *1* and *7*), and will default to the current value.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithWeekYear($weekYear, $week, $weekDay);\r\n```\r\n\r\n\r\n## Time Attributes\r\n\r\n**Get Hours**\r\n\r\nGet the hours of the day in current time zone.\r\n\r\nThe `$hours` returned will be between *0* and *23*.\r\n\r\n```php\r\n$hours = $dateTime-\u003egetHours();\r\n```\r\n\r\n**Get Milliseconds**\r\n\r\nGet the milliseconds of the second in current time zone.\r\n\r\nThe `$milliseconds` returned will be between *0* and *999*.\r\n\r\n```php\r\n$milliseconds = $dateTime-\u003egetMilliseconds();\r\n```\r\n\r\n**Get Minutes**\r\n\r\nGet the minutes of the hour in current time zone.\r\n\r\nThe `$minutes` returned will be between *0* and *59*.\r\n\r\n```php\r\n$minutes = $dateTime-\u003egetMinutes();\r\n```\r\n\r\n**Get Seconds**\r\n\r\nGet the seconds of the minute in current time zone.\r\n\r\nThe `$seconds` returned will be between *0* and *59*.\r\n\r\n```php\r\n$seconds = $dateTime-\u003egetSeconds();\r\n```\r\n\r\n**With Hours**\r\n\r\nClone the *DateTime* with a new hours of the day in current time zone.\r\n\r\n- `$hours` is a number representing the hours of the day (between *0* and *23*).\r\n- `$minutes` is a number representing the minutes of the hour (between *0* and *59*), and will default to the current value.\r\n- `$seconds` is a number representing the seconds of the minute (between *0* and *59*), and will default to the current value.\r\n- `$milliseconds` is a number representing the milliseconds of the second (between *0* and *999*), and will default to the current value.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithHours($hours, $minutes, $seconds, $milliseconds);\r\n```\r\n\r\n**With Milliseconds**\r\n\r\nClone the *DateTime* with a new milliseconds of the second in current time zone.\r\n\r\n- `$milliseconds` is a number representing the milliseconds of the second (between *0* and *999*).\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithMilliseconds($milliseconds);\r\n```\r\n\r\n**With Minutes**\r\n\r\nClone the *DateTime* with a new minutes of the hour in current time zone.\r\n\r\n- `$minutes` is a number representing the minutes of the hour (between *0* and *59*).\r\n- `$seconds` is a number representing the seconds of the minute (between *0* and *59*), and will default to the current value.\r\n- `$milliseconds` is a number representing the milliseconds of the second (between *0* and *999*), and will default to the current value.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithMinutes($minutes, $seconds, $milliseconds);\r\n```\r\n\r\n**With Seconds**\r\n\r\nClone the *DateTime* with a new seconds of the minute in current time zone.\r\n\r\n- `$seconds` is a number representing the seconds of the minute (between *0* and *59*).\r\n- `$milliseconds` is a number representing the milliseconds of the second (between *0* and *999*), and will default to the current value.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithSeconds($seconds, $milliseconds);\r\n```\r\n\r\n\r\n## Timestamps\r\n\r\n**Get Milliseconds**\r\n\r\nGet the number of milliseconds since the UNIX epoch.\r\n\r\n```php\r\n$time = $dateTime-\u003egetTime();\r\n```\r\n\r\n**Get Seconds**\r\n\r\nGet the number of seconds since the UNIX epoch.\r\n\r\n```php\r\n$timestamp = $dateTime-\u003egetTimestamp();\r\n```\r\n\r\n**With Milliseconds**\r\n\r\nClone the *DateTime* with a new number of milliseconds since the UNIX epoch.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithTime($time);\r\n```\r\n\r\n**With Seconds**\r\n\r\nClone the *DateTime* with a new number of seconds since the UNIX epoch.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithTimestamp($timestamp);\r\n```\r\n\r\n\r\n## Time Zones\r\n\r\n**Get Time Zone**\r\n\r\nGet the name of the current time zone.\r\n\r\n```php\r\n$timeZone = $dateTime-\u003egetTimeZone();\r\n```\r\n\r\n**Get Time Zone Offset**\r\n\r\nGet the UTC offset (in minutes) of the current time zone.\r\n\r\n```php\r\n$offset = $dateTime-\u003egetTimeZoneOffset();\r\n```\r\n\r\n**With Time Zone**\r\n\r\nClone the *DateTime* with a new time zone.\r\n\r\n- `$timeZone` is the name of the new time zone, which can be either \"*UTC*\", a supported value from the [IANA timeZone database](https://www.iana.org/time-zones) or an offset string.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithTimeZone($timeZone);\r\n```\r\n\r\n**With Time Zone Offset**\r\n\r\nClone the *DateTime* with a new UTC offset (in minutes).\r\n\r\n- `$offset` is the UTC offset (in minutes).\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithTimeZoneOffset($offset);\r\n```\r\n\r\n\r\n## Locales\r\n\r\n**Get Locale**\r\n\r\nGet the name of the current locale.\r\n\r\n```php\r\n$locale = $dateTime-\u003egetLocale();\r\n```\r\n\r\n**With Locale**\r\n\r\nClone the *DateTime* with a new locale.\r\n\r\n- `$locale` is the name of the new locale.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003ewithLocale($locale);\r\n```\r\n\r\n\r\n## Manipulation\r\n\r\n**Add Day**\r\n\r\nAdd a day to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddDay();\r\n```\r\n\r\n**Add Days**\r\n\r\nAdd days to the current date.\r\n\r\n- `$amount` is a number representing the amount of days to add.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddDay($amount);\r\n```\r\n\r\n**Add Hour**\r\n\r\nAdd a hour to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddHour();\r\n```\r\n\r\n**Add Hours**\r\n\r\nAdd hours to the current date.\r\n\r\n- `$amount` is a number representing the amount of hours to add.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddHours($amount);\r\n```\r\n\r\n**Add Minute**\r\n\r\nAdd a minute to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddMinute();\r\n```\r\n\r\n**Add Minutes**\r\n\r\nAdd minutes to the current date.\r\n\r\n- `$amount` is a number representing the amount of minutes to add.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddMinutes($amount);\r\n```\r\n\r\n**Add Month**\r\n\r\nAdd a month to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddMonth();\r\n```\r\n\r\n**Add Months**\r\n\r\nAdd months to the current date.\r\n\r\n- `$amount` is a number representing the amount of months to add.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddMonths($amount);\r\n```\r\n\r\n**Add Second**\r\n\r\nAdd a second to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddSecond();\r\n```\r\n\r\n**Add Seconds**\r\n\r\nAdd seconds to the current date.\r\n\r\n- `$amount` is a number representing the amount of seconds to add.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddSeconds($amount);\r\n```\r\n\r\n**Add Week**\r\n\r\nAdd a week to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddWeek();\r\n```\r\n\r\n**Add Weeks**\r\n\r\nAdd weeks to the current date.\r\n\r\n- `$amount` is a number representing the amount of weeks to add.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddWeeks($amount);\r\n```\r\n\r\n**Add Year**\r\n\r\nAdd a year to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddYear();\r\n```\r\n\r\n**Add Years**\r\n\r\nAdd years to the current date.\r\n\r\n- `$amount` is a number representing the amount of years to add.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eaddYears($amount);\r\n```\r\n\r\n**End Of Day**\r\n\r\nSet the date to the end of the day in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eendOfDay();\r\n```\r\n\r\n**End Of Hour**\r\n\r\nSet the date to the end of the hour in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eendOfHour();\r\n```\r\n\r\n**End Of Minute**\r\n\r\nSet the date to the end of the minute in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eendOfMinute();\r\n```\r\n\r\n**End Of Month**\r\n\r\nSet the date to the end of the month in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eendOfMonth();\r\n```\r\n\r\n**End Of Quarter**\r\n\r\nSet the date to the end of the quarter in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eendOfQuarter();\r\n```\r\n\r\n**End Of Second**\r\n\r\nSet the date to the end of the second in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eendOfSecond();\r\n```\r\n\r\n**End Of Week**\r\n\r\nSet the date to the end of the week in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eendOfWeek();\r\n```\r\n\r\n**End Of Year**\r\n\r\nSet the date to the end of the year in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003eendOfYear();\r\n```\r\n\r\n**Start Of Day**\r\n\r\nSet the date to the start of the day in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003estartOfDay();\r\n```\r\n\r\n**Start Of Hour**\r\n\r\nSet the date to the start of the hour in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003estartOfHour();\r\n```\r\n\r\n**Start Of Minute**\r\n\r\nSet the date to the start of the minute in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003estartOfMinute();\r\n```\r\n\r\n**Start Of Month**\r\n\r\nSet the date to the start of the month in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003estartOfMonth();\r\n```\r\n\r\n**Start Of Quarter**\r\n\r\nSet the date to the start of the quarter in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003estartOfQuarter();\r\n```\r\n\r\n**Start Of Second**\r\n\r\nSet the date to the start of the second in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003estartOfSecond();\r\n```\r\n\r\n**Start Of Week**\r\n\r\nSet the date to the start of the week in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003estartOfWeek();\r\n```\r\n\r\n**Start Of Year**\r\n\r\nSet the date to the start of the year in current time zone.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003estartOfYear();\r\n```\r\n\r\n**Subtract Day**\r\n\r\nSubtract a day to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractDay();\r\n```\r\n\r\n**Subtract Days**\r\n\r\nSubtract days to the current date.\r\n\r\n- `$amount` is a number representing the amount of days to subtract.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractDay($amount);\r\n```\r\n\r\n**Subtract Hour**\r\n\r\nSubtract a hour to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractHour();\r\n```\r\n\r\n**Subtract Hours**\r\n\r\nSubtract hours to the current date.\r\n\r\n- `$amount` is a number representing the amount of hours to subtract.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractHours($amount);\r\n```\r\n\r\n**Subtract Minute**\r\n\r\nSubtract a minute to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractMinute();\r\n```\r\n\r\n**Subtract Minutes**\r\n\r\nSubtract minutes to the current date.\r\n\r\n- `$amount` is a number representing the amount of minutes to subtract.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractMinutes($amount);\r\n```\r\n\r\n**Subtract Month**\r\n\r\nSubtract a month to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractMonth();\r\n```\r\n\r\n**Subtract Months**\r\n\r\nSubtract months to the current date.\r\n\r\n- `$amount` is a number representing the amount of months to subtract.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractMonths($amount);\r\n```\r\n\r\n**Subtract Second**\r\n\r\nSubtract a second to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractSecond();\r\n```\r\n\r\n**Subtract Seconds**\r\n\r\nSubtract seconds to the current date.\r\n\r\n- `$amount` is a number representing the amount of seconds to subtract.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractSeconds($amount);\r\n```\r\n\r\n**Subtract Week**\r\n\r\nSubtract a week to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractWeek();\r\n```\r\n\r\n**Subtract Weeks**\r\n\r\nSubtract weeks to the current date.\r\n\r\n- `$amount` is a number representing the amount of weeks to subtract.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractWeeks($amount);\r\n```\r\n\r\n**Subtract Year**\r\n\r\nSubtract a year to the current date.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractYear();\r\n```\r\n\r\n**Subtract Years**\r\n\r\nSubtract years to the current date.\r\n\r\n- `$amount` is a number representing the amount of years to subtract.\r\n\r\n```php\r\n$newDateTime = $dateTime-\u003esubtractYears($amount);\r\n```\r\n\r\n\r\n## Comparisons\r\n\r\n**Difference**\r\n\r\nGet the difference between two dates in milliseconds.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$diff = $dateTime-\u003ediff($other);\r\n```\r\n\r\n**Difference In Days**\r\n\r\nGet the difference between two dates in days.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n- `$relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```php\r\n$diff = $dateTime-\u003ediffInDays($other, $relative);\r\n```\r\n\r\nIf `$relative` is *true* (default) the value returned will be the relative difference, ignoring higher precision properties.\r\n\r\n**Difference In Hours**\r\n\r\nGet the difference between two dates in hours.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n- `$relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```php\r\n$diff = $dateTime-\u003ediffInHours($other, $relative);\r\n```\r\n\r\nIf `$relative` is *true* (default) the value returned will be the relative difference, ignoring higher precision properties.\r\n\r\n**Difference In Minutes**\r\n\r\nGet the difference between two dates in minutes.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n- `$relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```php\r\n$diff = $dateTime-\u003ediffInMinutes($other, $relative);\r\n```\r\n\r\nIf `$relative` is *true* (default) the value returned will be the relative difference, ignoring higher precision properties.\r\n\r\n**Difference In Months**\r\n\r\nGet the difference between two dates in months.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n- `$relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```php\r\n$diff = $dateTime-\u003ediffInMonths($other, $relative);\r\n```\r\n\r\nIf `$relative` is *true* (default) the value returned will be the relative difference, ignoring higher precision properties.\r\n\r\n**Difference In Seconds**\r\n\r\nGet the difference between two dates in seconds.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n- `$relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```php\r\n$diff = $dateTime-\u003ediffInSeconds($other, $relative);\r\n```\r\n\r\nIf `$relative` is *true* (default) the value returned will be the relative difference, ignoring higher precision properties.\r\n\r\n**Difference In Weeks**\r\n\r\nGet the difference between two dates in weeks.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n- `$relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```php\r\n$diff = $dateTime-\u003ediffInWeeks($other, $relative);\r\n```\r\n\r\nIf `$relative` is *true* (default) the value returned will be the relative difference, ignoring higher precision properties.\r\n\r\n**Difference In Years**\r\n\r\nGet the difference between two dates in years.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n- `$relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```php\r\n$diff = $dateTime-\u003ediffInYears($other, $relative);\r\n```\r\n\r\nIf `$relative` is *true* (default) the value returned will be the relative difference, ignoring higher precision properties.\r\n\r\n**Is After?**\r\n\r\nDetermine whether the *DateTime* is after another date.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isAfter = $dateTime-\u003eisAfter($other);\r\n```\r\n\r\n**Is After Day?**\r\n\r\nDetermine whether the *DateTime* is after another date (comparing by day).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isAfter = $dateTime-\u003eisAfterDay($other);\r\n```\r\n\r\n**Is After Hour?**\r\n\r\nDetermine whether the *DateTime* is after another date (comparing by hour).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isAfter = $dateTime-\u003eisAfterHour($other);\r\n```\r\n\r\n**Is After Minute?**\r\n\r\nDetermine whether the *DateTime* is after another date (comparing by minute).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isAfter = $dateTime-\u003eisAfterMinute($other);\r\n```\r\n\r\n**Is After Month?**\r\n\r\nDetermine whether the *DateTime* is after another date (comparing by month).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isAfter = $dateTime-\u003eisAfterMonth($other);\r\n```\r\n\r\n**Is After Second?**\r\n\r\nDetermine whether the *DateTime* is after another date (comparing by second).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isAfter = $dateTime-\u003eisAfterSecond($other);\r\n```\r\n\r\n**Is After Week?**\r\n\r\nDetermine whether the *DateTime* is after another date (comparing by week).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isAfter = $dateTime-\u003eisAfterWeek($other);\r\n```\r\n\r\n**Is After Year?**\r\n\r\nDetermine whether the *DateTime* is after another date (comparing by year).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isAfter = $dateTime-\u003eisAfterYear($other);\r\n```\r\n\r\n**Is Before?**\r\n\r\nDetermine whether the *DateTime* is before another date.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isBefore = $dateTime-\u003eisBefore($other);\r\n```\r\n\r\n**Is Before Day?**\r\n\r\nDetermine whether the *DateTime* is before another date (comparing by day).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isBefore = $dateTime-\u003eisBeforeDay($other);\r\n```\r\n\r\n**Is Before Hour?**\r\n\r\nDetermine whether the *DateTime* is before another date (comparing by hour).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isBefore = $dateTime-\u003eisBeforeHour($other);\r\n```\r\n\r\n**Is Before Minute?**\r\n\r\nDetermine whether the *DateTime* is before another date (comparing by minute).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isBefore = $dateTime-\u003eisBeforeMinute($other);\r\n```\r\n\r\n**Is Before Month?**\r\n\r\nDetermine whether the *DateTime* is before another date (comparing by month).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isBefore = $dateTime-\u003eisBeforeMonth($other);\r\n```\r\n\r\n**Is Before Second?**\r\n\r\nDetermine whether the *DateTime* is before another date (comparing by second).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isBefore = $dateTime-\u003eisBeforeSecond($other);\r\n```\r\n\r\n**Is Before Week?**\r\n\r\nDetermine whether the *DateTime* is before another date (comparing by week).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isBefore = $dateTime-\u003eisBeforeWeek($other);\r\n```\r\n\r\n**Is Before Year?**\r\n\r\nDetermine whether the *DateTime* is before another date (comparing by year).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isBefore = $dateTime-\u003eisBeforeYear($other);\r\n```\r\n\r\n**Is Between?**\r\n\r\nDetermine whether the *DateTime* is between two other dates.\r\n\r\n- `$start` is the starting *DateTime* object to compare to.\r\n- `$end` is the ending *DateTime* object to compare to.\r\n\r\n```php\r\n$isBetween = $dateTime-\u003eisBetween($start, $end);\r\n```\r\n\r\n**Is Between Day?**\r\n\r\nDetermine whether the *DateTime* is between two other dates (comparing by day).\r\n\r\n- `$start` is the starting *DateTime* object to compare to.\r\n- `$end` is the ending *DateTime* object to compare to.\r\n\r\n```php\r\n$isBetween = $dateTime-\u003eisBetweenDay($start, $end);\r\n```\r\n\r\n**Is Between Hour?**\r\n\r\nDetermine whether the *DateTime* is between two other dates (comparing by hour).\r\n\r\n- `$start` is the starting *DateTime* object to compare to.\r\n- `$end` is the ending *DateTime* object to compare to.\r\n\r\n```php\r\n$isBetween = $dateTime-\u003eisBetweenHour($start, $end);\r\n```\r\n\r\n**Is Between Minute?**\r\n\r\nDetermine whether the *DateTime* is between two other dates (comparing by minute).\r\n\r\n- `$start` is the starting *DateTime* object to compare to.\r\n- `$end` is the ending *DateTime* object to compare to.\r\n\r\n```php\r\n$isBetween = $dateTime-\u003eisBetweenMinute($start, $end);\r\n```\r\n\r\n**Is Between Month?**\r\n\r\nDetermine whether the *DateTime* is between two other dates (comparing by month).\r\n\r\n- `$start` is the starting *DateTime* object to compare to.\r\n- `$end` is the ending *DateTime* object to compare to.\r\n\r\n```php\r\n$isBetween = $dateTime-\u003eisBetweenMonth($start, $end);\r\n```\r\n\r\n**Is Between Second?**\r\n\r\nDetermine whether the *DateTime* is between two other dates (comparing by second).\r\n\r\n- `$start` is the starting *DateTime* object to compare to.\r\n- `$end` is the ending *DateTime* object to compare to.\r\n\r\n```php\r\n$isBetween = $dateTime-\u003eisBetweenSecond($start, $end);\r\n```\r\n\r\n**Is Between Week?**\r\n\r\nDetermine whether the *DateTime* is between two other dates (comparing by week).\r\n\r\n- `$start` is the starting *DateTime* object to compare to.\r\n- `$end` is the ending *DateTime* object to compare to.\r\n\r\n```php\r\n$isBetween = $dateTime-\u003eisBetweenWeek($start, $end);\r\n```\r\n\r\n**Is Between Year?**\r\n\r\nDetermine whether the *DateTime* is between two other dates (comparing by year).\r\n\r\n- `$start` is the starting *DateTime* object to compare to.\r\n- `$end` is the ending *DateTime* object to compare to.\r\n\r\n```php\r\n$isBetween = $dateTime-\u003eisBetweenYear($start, $end);\r\n```\r\n\r\n**Is Same?**\r\n\r\nDetermine whether the *DateTime* is the same as another date.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSame = $dateTime-\u003eisSame($other);\r\n```\r\n\r\n**Is Same Day?**\r\n\r\nDetermine whether the *DateTime* is the same as another date (comparing by day).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSame = $dateTime-\u003eisSameDay($other);\r\n```\r\n\r\n**Is Same Hour?**\r\n\r\nDetermine whether the *DateTime* is the same as another date (comparing by hour).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSame = $dateTime-\u003eisSameHour($other);\r\n```\r\n\r\n**Is Same Minute?**\r\n\r\nDetermine whether the *DateTime* is the same as another date (comparing by minute).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSame = $dateTime-\u003eisSameMinute($other);\r\n```\r\n\r\n**Is Same Month?**\r\n\r\nDetermine whether the *DateTime* is the same as another date (comparing by month).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSame = $dateTime-\u003eisSameMonth($other);\r\n```\r\n\r\n**Is Same Second?**\r\n\r\nDetermine whether the *DateTime* is the same as another date (comparing by second).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSame = $dateTime-\u003eisSameSecond($other);\r\n```\r\n\r\n**Is Same Week?**\r\n\r\nDetermine whether the *DateTime* is the same as another date (comparing by week).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSame = $dateTime-\u003eisSameWeek($other);\r\n```\r\n\r\n**Is Same Year?**\r\n\r\nDetermine whether the *DateTime* is the same as another date (comparing by year).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSame = $dateTime-\u003eisSameYear($other);\r\n```\r\n\r\n**Is Same Or After?**\r\n\r\nDetermine whether the *DateTime* is the same as or after another date.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrAfter = $dateTime-\u003eisSameOrAfter($other);\r\n```\r\n\r\n**Is Same Or After Day?**\r\n\r\nDetermine whether the *DateTime* is the same as or after another date (comparing by day).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrAfter = $dateTime-\u003eisSameOrAfterDay($other);\r\n```\r\n\r\n**Is Same Or After Hour?**\r\n\r\nDetermine whether the *DateTime* is the same as or after another date (comparing by hour).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrAfter = $dateTime-\u003eisSameOrAfterHour($other);\r\n```\r\n\r\n**Is Same Or After Minute?**\r\n\r\nDetermine whether the *DateTime* is the same as or after another date (comparing by minute).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrAfter = $dateTime-\u003eisSameOrAfterMinute($other);\r\n```\r\n\r\n**Is Same Or After Month?**\r\n\r\nDetermine whether the *DateTime* is the same as or after another date (comparing by month).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrAfter = $dateTime-\u003eisSameOrAfterMonth($other);\r\n```\r\n\r\n**Is Same Or After Second?**\r\n\r\nDetermine whether the *DateTime* is the same as or after another date (comparing by second).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrAfter = $dateTime-\u003eisSameOrAfterSecond($other);\r\n```\r\n\r\n**Is Same Or After Week?**\r\n\r\nDetermine whether the *DateTime* is the same as or after another date (comparing by week).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrAfter = $dateTime-\u003eisSameOrAfterWeek($other);\r\n```\r\n\r\n**Is Same Or After Year?**\r\n\r\nDetermine whether the *DateTime* is the same as or after another date (comparing by year).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrAfter = $dateTime-\u003eisSameOrAfterYear($other);\r\n```\r\n\r\n**Is Same Or Before?**\r\n\r\nDetermine whether the *DateTime* is the same as or before another date.\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrBefore = $dateTime-\u003eisSameOrBefore($other);\r\n```\r\n\r\n**Is Same Or Before Day?**\r\n\r\nDetermine whether the *DateTime* is the same as or before another date (comparing by day).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrBefore = $dateTime-\u003eisSameOrBeforeDay($other);\r\n```\r\n\r\n**Is Same Or Before Hour?**\r\n\r\nDetermine whether the *DateTime* is the same as or before another date (comparing by hour).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrBefore = $dateTime-\u003eisSameOrBeforeHour($other);\r\n```\r\n\r\n**Is Same Or Before Minute?**\r\n\r\nDetermine whether the *DateTime* is the same as or before another date (comparing by minute).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrBefore = $dateTime-\u003eisSameOrBeforeMinute($other);\r\n```\r\n\r\n**Is Same Or Before Month?**\r\n\r\nDetermine whether the *DateTime* is the same as or before another date (comparing by month).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrBefore = $dateTime-\u003eisSameOrBeforeMonth($other);\r\n```\r\n\r\n**Is Same Or Before Second?**\r\n\r\nDetermine whether the *DateTime* is the same as or before another date (comparing by second).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrBefore = $dateTime-\u003eisSameOrBeforeSecond($other);\r\n```\r\n\r\n**Is Same Or Before Week?**\r\n\r\nDetermine whether the *DateTime* is the same as or before another date (comparing by week).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrBefore = $dateTime-\u003eisSameOrBeforeWeek($other);\r\n```\r\n\r\n**Is Same Or Before Year?**\r\n\r\nDetermine whether the *DateTime* is the same as or before another date (comparing by year).\r\n\r\n- `$other` is the *DateTime* object to compare to.\r\n\r\n```php\r\n$isSameOrBefore = $dateTime-\u003eisSameOrBeforeYear($other);\r\n```\r\n\r\n\r\n## Utility Methods\r\n\r\n**Day Name**\r\n\r\nGet the name of the day of the week in current time zone and locale.\r\n\r\n- `$type` can be either \"*long*\", \"*short*\" or \"*narrow*\", and will default to \"*long*\" if it is not set.\r\n\r\n```php\r\n$dayName = $dateTime-\u003edayName($type);\r\n```\r\n\r\n**Day Period**\r\n\r\nGet the day period in current time zone and locale.\r\n\r\n- `$type` can be either \"*long*\" or \"*short*\", and will default to \"*long*\" if it is not set.\r\n\r\n```php\r\n$dayPeriod = $dateTime-\u003edayPeriod($type);\r\n```\r\n\r\n**Days In Month**\r\n\r\nGet the number of days in the current month.\r\n\r\n```php\r\n$daysInMonth = $dateTime-\u003edaysInMonth();\r\n```\r\n\r\n**Days In Year**\r\n\r\nGet the number of days in the current year.\r\n\r\n```php\r\n$daysInYear = $dateTime-\u003edaysInYear();\r\n```\r\n\r\n**Era**\r\n\r\nGet the era in current time zone and locale.\r\n\r\n- `$type` can be either \"*long*\", \"*short*\" or \"*narrow*\", and will default to \"*long*\" if it is not set.\r\n\r\n```php\r\n$era = $dateTime-\u003eera($type);\r\n```\r\n\r\n**Is DST?**\r\n\r\nDetermine whether the *DateTime* is in daylight savings.\r\n\r\n```php\r\n$isDst = $dateTime-\u003eisDst();\r\n```\r\n\r\n**Is Leap Year?**\r\n\r\nDetermine whether the year is a leap year.\r\n\r\n```php\r\n$isLeapYear = $dateTime-\u003eisLeapYear();\r\n```\r\n\r\n**Month Name**\r\n\r\nGet the name of the month in current time zone and locale.\r\n\r\n- `$type` can be either \"*long*\", \"*short*\" or \"*narrow*\", and will default to \"*long*\" if it is not set.\r\n\r\n```php\r\n$monthName = $dateTime-\u003emonthName($type);\r\n```\r\n\r\n**Time Zone Name**\r\n\r\nGet the name of the current time zone and locale.\r\n\r\n- `$type` can be either \"*long*\" or \"*short*\", and will default to \"*long*\" if it is not set.\r\n\r\n```php\r\n$timeZoneName = $dateTime-\u003etimeZoneName($type);\r\n```\r\n\r\n**Weeks In Year**\r\n\r\nGet the number of weeks in the current year.\r\n\r\n```php\r\n$weeksInYear = $dateTime-\u003eweeksInYear();\r\n```\r\n\r\n\r\n## Static Methods\r\n\r\n**Get Default Locale**\r\n\r\nGet the default locale.\r\n\r\n```php\r\n$locale = DateTime::getDefaultLocale();\r\n```\r\n\r\n**Get Default Time Zone**\r\n\r\nGet the default time zone.\r\n\r\n```php\r\n$timeZone = DateTime::getDefaultTimeZone();\r\n```\r\n\r\n**Set Date Clamping**\r\n\r\nSet whether dates will be clamped when changing months.\r\n\r\n- `$clampDates` is a boolean indicating whether to clamp dates.\r\n\r\n```php\r\nDateTime::setDateClamping($clampDates);\r\n```\r\n\r\n**Set Default Locale**\r\n\r\nSet the default locale.\r\n\r\n- `$locale` is the locale.\r\n\r\n```php\r\nDateTime::setDefaultLocale($locale);\r\n```\r\n\r\n**Set Default Time Zone**\r\n\r\nSet the default time zone.\r\n\r\n- `$timeZone` is the time zone, which can be either \"*UTC*\", a supported value from the [IANA time zone database](https://www.iana.org/time-zones), or an offset string.\r\n\r\n```php\r\nDateTime::setDefaultTimeZone($timeZone);\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyredatetime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felusivecodes%2Ffyredatetime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyredatetime/lists"}