{"_id":"@bjnstnkvc/carbon","_rev":"3-f455377074ea112daaa94cee352a2688","name":"@bjnstnkvc/carbon","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@bjnstnkvc/carbon","version":"1.0.0","description":"JavaScript equivalent of Carbon date and time manipulation library.","main":"lib/main.js","source":"src/main.ts","directories":{"lib":"lib"},"scripts":{"test":"jest --config jestconfig.json ./tests","build":"tsc","prod":"tsc && uglifyjs lib/main.js -c -m -o lib/main.min.js"},"repository":{"type":"git","url":"git+https://github.com/BJNSTNKVC/js-carbon.git"},"keywords":["date","time"],"author":{"name":"Bojan Stankovic"},"license":"MIT","bugs":{"url":"https://github.com/BJNSTNKVC/js-carbon/issues"},"homepage":"https://github.com/BJNSTNKVC/js-carbon#readme","devDependencies":{"@types/jest":"^29.5.12","@types/node":"^20.11.19","jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.3.3","uglify-js":"^3.17.4"},"_id":"@bjnstnkvc/carbon@1.0.0","gitHead":"f8c00b02e057b9ed5540c0a794c7ff341d3dc86c","_nodeVersion":"21.3.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-ddaejxYHteFJQFJPVwU+DU1TQ3Ry8/Wtl8LmTEG2Vd1rTSBFkEv6YW0nRnoUrq0RWb0oVJHAqeL+jXAcMffNTQ==","shasum":"cd6a909ae36af88b2aaa4a9b947d7a955382aefd","tarball":"https://registry.npmjs.org/@bjnstnkvc/carbon/-/carbon-1.0.0.tgz","fileCount":11,"unpackedSize":372601,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3AA4u2p5RD7e9ZJCuswQx7s1J+CsF93U6I/NhgOkhfAIhAJ72B12h5Yki+8m83/IDHVUG6PoxfJu8+nlWfK5eXuqs"}]},"_npmUser":{"name":"bjnstnkvc","email":"dev.bojan.stankovic@gmail.com"},"maintainers":[{"name":"bjnstnkvc","email":"dev.bojan.stankovic@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/carbon_1.0.0_1710795161237_0.8668277910243536"},"_hasShrinkwrap":false},"1.0.1":{"name":"@bjnstnkvc/carbon","version":"1.0.1","description":"JavaScript equivalent of Carbon date and time manipulation library.","main":"lib/main.js","source":"src/main.ts","directories":{"lib":"lib"},"scripts":{"test":"jest --config jestconfig.json ./tests","build":"tsc","prod":"tsc && uglifyjs lib/main.js -c -m -o lib/main.min.js"},"repository":{"type":"git","url":"git+https://github.com/BJNSTNKVC/js-carbon.git"},"keywords":["date","time"],"author":{"name":"Bojan Stankovic"},"license":"MIT","bugs":{"url":"https://github.com/BJNSTNKVC/js-carbon/issues"},"homepage":"https://github.com/BJNSTNKVC/js-carbon#readme","devDependencies":{"@types/jest":"^29.5.12","@types/node":"^20.11.19","jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.3.3","uglify-js":"^3.17.4"},"_id":"@bjnstnkvc/carbon@1.0.1","gitHead":"236e9f28d1160a4bc1a99a1419c151db5b90f07f","_nodeVersion":"21.3.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-PGkCWwKO58hQkl+NJfQJliiv3c+Ey/m7MxICHMH8BQA+Zy7nJJOTzaodNoyMRsXGLFHmqYiFFtwdWIPotZmx/w==","shasum":"90073f07415c6601cfa2942f2150c83d8b6d0ce8","tarball":"https://registry.npmjs.org/@bjnstnkvc/carbon/-/carbon-1.0.1.tgz","fileCount":11,"unpackedSize":410244,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/RemX1zaLdxaLdPC8W+CvDtofbPG0NrS4jVrx2xrMGgIgXwV7IlnLk8sS5RSwPgYCJ+R+wY1T4BHBg9T8MxaPXkk="}]},"_npmUser":{"name":"bjnstnkvc","email":"dev.bojan.stankovic@gmail.com"},"maintainers":[{"name":"bjnstnkvc","email":"dev.bojan.stankovic@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/carbon_1.0.1_1711580723346_0.010263119377826202"},"_hasShrinkwrap":false},"1.0.2":{"name":"@bjnstnkvc/carbon","version":"1.0.2","description":"JavaScript equivalent of Carbon date and time manipulation library.","main":"lib/main.js","source":"src/main.ts","directories":{"lib":"lib"},"scripts":{"test":"env TZ='CET' jest --config jestconfig.json ./tests","build":"tsc","prod":"tsc && uglifyjs lib/main.js -c -m -o lib/main.min.js"},"repository":{"type":"git","url":"git+https://github.com/BJNSTNKVC/js-carbon.git"},"keywords":["date","time"],"author":{"name":"Bojan Stankovic"},"license":"MIT","bugs":{"url":"https://github.com/BJNSTNKVC/js-carbon/issues"},"homepage":"https://github.com/BJNSTNKVC/js-carbon#readme","devDependencies":{"@types/jest":"^29.5.12","@types/node":"^20.11.19","jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.3.3","uglify-js":"^3.17.4"},"_id":"@bjnstnkvc/carbon@1.0.2","gitHead":"e4d7c19a01e850204ec6bfb8c127caf85b2b889f","_nodeVersion":"21.3.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-QVv3FN90c4iXMttBVapP2hWGFtFsZiI2I5n/BIWMgVIAZifXeMMlq5uLITc8XfKiA29Ie6Y1mmYxmxCEDiudtg==","shasum":"3b1cf186318332959fa71332e7c026812d4ef29f","tarball":"https://registry.npmjs.org/@bjnstnkvc/carbon/-/carbon-1.0.2.tgz","fileCount":11,"unpackedSize":483314,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAWIERKQA9kudmDsrFRzdFXPFatGPo5MDeviCavsBoLGAiB8GXRGRSA4FM2CwnMlTpsqyC71IzLXRCBrtTdAM0s87g=="}]},"_npmUser":{"name":"bjnstnkvc","email":"dev.bojan.stankovic@gmail.com"},"maintainers":[{"name":"bjnstnkvc","email":"dev.bojan.stankovic@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/carbon_1.0.2_1716502611973_0.8934259656637631"},"_hasShrinkwrap":false},"1.0.3":{"name":"@bjnstnkvc/carbon","version":"1.0.3","description":"JavaScript equivalent of Carbon date and time manipulation library.","main":"lib/main.js","source":"src/main.ts","directories":{"lib":"lib"},"scripts":{"test":"env TZ='CET' jest --config jestconfig.json ./tests","build":"tsc","prod":"tsc && uglifyjs lib/main.js -c -m -o lib/main.min.js"},"repository":{"type":"git","url":"git+https://github.com/BJNSTNKVC/js-carbon.git"},"keywords":["date","time"],"author":{"name":"Bojan Stankovic"},"license":"MIT","bugs":{"url":"https://github.com/BJNSTNKVC/js-carbon/issues"},"homepage":"https://github.com/BJNSTNKVC/js-carbon#readme","devDependencies":{"@types/jest":"^29.5.12","@types/node":"^20.11.19","jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.3.3","uglify-js":"^3.17.4"},"_id":"@bjnstnkvc/carbon@1.0.3","gitHead":"339bdd44f99d15ec5c39892caff59a78fb210b80","_nodeVersion":"21.4.0","_npmVersion":"10.2.5","dist":{"integrity":"sha512-4ohK2/9e+s6/gL+Bo02suV+S6LEsjEFShTRMzaehiJkF+SEe7PNTV9qXFVBTkVN4MuwCCEir90DUG4h3e+Yp8Q==","shasum":"c04e882347fc9595c6e68381587ac52155d069e7","tarball":"https://registry.npmjs.org/@bjnstnkvc/carbon/-/carbon-1.0.3.tgz","fileCount":11,"unpackedSize":486368,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSApjgVVAlW2FFq2o3j2bDjMcxHpeCgn9fbWG2noz2FwIhAJh02tFeQB6TCfw4f6Kfn0CxIvgnYEQsmpF7NKavSKGw"}]},"_npmUser":{"name":"bjnstnkvc","email":"dev.bojan.stankovic@gmail.com"},"maintainers":[{"name":"bjnstnkvc","email":"dev.bojan.stankovic@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/carbon_1.0.3_1716532932012_0.9412247015978181"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-18T20:52:41.160Z","1.0.0":"2024-03-18T20:52:41.442Z","modified":"2024-05-24T06:42:12.374Z","1.0.1":"2024-03-27T23:05:23.584Z","1.0.2":"2024-05-23T22:16:52.166Z","1.0.3":"2024-05-24T06:42:12.197Z"},"maintainers":[{"name":"bjnstnkvc","email":"dev.bojan.stankovic@gmail.com"}],"description":"JavaScript equivalent of Carbon date and time manipulation library.","homepage":"https://github.com/BJNSTNKVC/js-carbon#readme","keywords":["date","time"],"repository":{"type":"git","url":"git+https://github.com/BJNSTNKVC/js-carbon.git"},"author":{"name":"Bojan Stankovic"},"bugs":{"url":"https://github.com/BJNSTNKVC/js-carbon/issues"},"license":"MIT","readme":"# Carbon\r\n\r\nJavaScript equivalent of Carbon date and time manipulation library.\r\n\r\n## Installation & setup\r\n\r\n### NPM\r\n\r\nYou can install the package via npm:\r\n\r\n```bash\r\nnpm install @bjnstnkvc/carbon\r\n````\r\n\r\nand then import it into your project\r\n\r\n```javascript\r\nimport { Carbon } from '@bjnstnkvc/carbon';\r\n```\r\n\r\n### CDN\r\n\r\nYou can install the package via jsDelivr CDN:\r\n\r\n```html\r\n\r\n<script src=\"https://cdn.jsdelivr.net/npm/@bjnstnkvc/carbon/lib/main.min.js\"></script>\r\n```\r\n\r\n## Usage\r\n\r\n### Basic\r\n\r\nEasily create, manipulate, and interact with date and time objects using Carbon's intuitive API.\r\n\r\n#### Constructor\r\n\r\nCreate new Carbon instance.\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - A string representing the date. Defaults to `null`.\r\n- **timezone** *(optional)* - A string representing the timezone. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = new Carbon('2024-03-14');\r\n\r\nconsole.log(carbon); // 2024-03-14 01:00:00.000 UTC (+01:00)\r\n````\r\n\r\n```javascript\r\nconst carbon = new Carbon('2024-03-14', 'UTC');\r\n\r\nconsole.log(carbon); // 2024-03-14 00:00:00.000 UTC (+00:00)\r\n````\r\n\r\nIf the `date` is not passed, Carbon return's current date and time.\r\n\r\n#### now\r\n\r\nGet a Carbon instance for the current date and time.\r\n\r\n###### Parameters\r\n\r\n- **timezone** *(optional)*: A string representing the timezone. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.now();\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.now('UTC');\r\n```\r\n\r\n#### today\r\n\r\nGet a Carbon instance for today.\r\n\r\n##### Parameters\r\n\r\n- **timezone** *(optional)* - A string representing the timezone. Defaults to `null`.\r\n\r\n##### Returns\r\n\r\nA Carbon instance representing today's date.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.today();\r\n\r\nconsole.log(carbon); // 2024-03-14 01:00:00.000 UTC (+01:00)\r\n````\r\n\r\n```javascript\r\nconst carbon = Carbon.today('UTC');\r\n\r\nconsole.log(carbon); // 2024-03-14 00:00:00.000 UTC (+00:00)\r\n````\r\n\r\n> **Note:** This example assumes the current date is 2024-03-24.\r\n\r\n#### tomorrow\r\n\r\nGet a Carbon instance for tomorrow.\r\n\r\n##### Parameters\r\n\r\n- **timezone** *(optional)* - A string representing the timezone. Defaults to `null`.\r\n\r\n##### Returns\r\n\r\nA Carbon instance representing tomorrow's date.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.tomorrow();\r\n\r\nconsole.log(carbon); // 2024-03-15 00:00:00.000 UTC (+01:00)\r\n````\r\n\r\n```javascript\r\nconst carbon = Carbon.tomorrow('UTC');\r\n\r\nconsole.log(carbon); // 2024-03-15 00:00:00.000 UTC (+00:00)\r\n````\r\n\r\n> **Note:** This example assumes the current date is 2024-03-24.\r\n\r\n#### yesterday\r\n\r\nGet a Carbon instance for yesterday.\r\n\r\n##### Parameters\r\n\r\n- **timezone** *(optional)* - A string representing the timezone. Defaults to `null`.\r\n\r\n##### Returns\r\n\r\nA Carbon instance representing yesterday's date.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.yesterday();\r\n\r\nconsole.log(carbon); // 2024-03-13 00:00:00.000 UTC (+01:00)\r\n````\r\n\r\n```javascript\r\nconst carbon = Carbon.yesterday('UTC');\r\n\r\nconsole.log(carbon); // 2024-03-13 00:00:00.000 UTC (+00:00)\r\n````\r\n\r\n> **Note:** This example assumes the current date is 2024-03-24.\r\n\r\n#### parse\r\n\r\nParse the date.\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - A string representing the date. Defaults to `null`.\r\n- **timezone** *(optional)* - A string representing the timezone. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14');\r\n\r\nconsole.log(carbon); // 2024-03-14 01:00:00.000 UTC (+01:00)\r\n````\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14', 'UTC');\r\n\r\nconsole.log(carbon); // 2024-03-14 00:00:00.000 UTC (+00:00)\r\n````\r\n\r\n### Formatting\r\n\r\nEffortlessly format dates and times according to your preferred style and locale with Carbon's flexible formatting\r\noptions.\r\n\r\n#### format\r\n\r\nReturns the formatted date string.\r\n\r\n##### Parameters\r\n\r\n- **format** - A string representing the date format.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14').format('Y-m-d H:i:s');\r\n\r\nconsole.log(carbon); // 2024-03-14 01:00:00\r\n````\r\n\r\nThe `format` method accepts a string that can contain any combination of the following tokens:\r\n\r\n| Format character | Description                                                                                                                                                                                                                         | Example                                 |\r\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|\r\n| d                | Day of the month, 2 digits with leading zeros.                                                                                                                                                                                      | 01 to 31                                |\r\n| D                | A textual representation of a day, three letters.                                                                                                                                                                                   | Mon through Sun                         |\r\n| j                | Day of the month without leading zeros.                                                                                                                                                                                             | 1 to 31                                 |\r\n| l                | A full textual representation of the day of the week.                                                                                                                                                                               | Sunday through Saturday                 |\r\n| N                | ISO 8601 numeric representation of the day of the week.                                                                                                                                                                             | 1 (for Monday) through 7 (for Sunday)   |\r\n| S                | English ordinal suffix for the day of the month, 2 characters.                                                                                                                                                                      | st, nd, rd or th                        |\r\n| w                | Numeric representation of the day of the week.                                                                                                                                                                                      | 0 (for Sunday) through 6 (for Saturday) |\r\n| z                | Numeric representation of the day of the week.                                                                                                                                                                                      | The day of the year (starting from 0)   |\r\n| W                | ISO 8601 week number of year, weeks starting on Monday.                                                                                                                                                                             | 42 (the 42nd week in the year)          |\r\n| F                | A full textual representation of a month, such as January or March.                                                                                                                                                                 | January through December                |\r\n| m                | Numeric representation of a month, with leading zeros.                                                                                                                                                                              | 01 through 12                           |\r\n| M                | A short textual representation of a month, three letters.                                                                                                                                                                           | Jan through Dec                         |\r\n| n                | Numeric representation of a month, without leading zeros.                                                                                                                                                                           | 1 through 12                            |\r\n| t                | Number of days in the given month.                                                                                                                                                                                                  | 28 through 31                           |\r\n| L                | Whether it's a leap year.                                                                                                                                                                                                           | 1 if it is a leap year, 0 otherwise     |\r\n| o                | ISO 8601 week-numbering year. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.                                                                 | 1999 or 2003                            |\r\n| X                | An expanded full numeric representation of a year, at least 4 digits, with for years BCE, and + for years CE.                                                                                                                       | -0055, +0787, +1999, +10191             |\r\n| x                | An expanded full numeric representation if required, or a standard full numeral representation if possible (like Y). At least four digits. Years BCE are prefixed with a -. Years beyond (and including) 10000 are prefixed by a +. | -0055, 0787, 1999, +10191               |\r\n| Y                | A full numeric representation of a year, at least 4 digits, with for years BCE.                                                                                                                                                     | -0055, 0787, 1999, 2003, 10191          |\r\n| y                | A two-digit representation of a year.                                                                                                                                                                                               | 99 or 03                                |\r\n| a                | Lowercase Ante meridiem and Post meridiem.                                                                                                                                                                                          | am or pm                                |\r\n| A                | Uppercase Ante meridiem and Post meridiem.                                                                                                                                                                                          | AM or PM                                |\r\n| B                | Swatch Internet time.                                                                                                                                                                                                               | 000 through 999                         |\r\n| g                | 12-hour format of an hour without leading zeros.                                                                                                                                                                                    | 1 through 12                            |\r\n| G                | 24-hour format of an hour without leading zeros.                                                                                                                                                                                    | 0 through 23                            |\r\n| h                | 12-hour format of an hour with leading zeros.                                                                                                                                                                                       | 01 through 12                           |\r\n| H                | 24-hour format of an hour with leading zeros.                                                                                                                                                                                       | 00 through 23                           |\r\n| i                | Minutes with leading zeros.                                                                                                                                                                                                         | 00 to 59                                |\r\n| s                | Seconds with leading zeros.                                                                                                                                                                                                         | 00 to 59                                |\r\n| u                | Microseconds.                                                                                                                                                                                                                       | 654321                                  |\r\n| v                | Milliseconds.                                                                                                                                                                                                                       | 654                                     |\r\n| e                | Timezone identifier.                                                                                                                                                                                                                | UTC, GMT, Atlantic/Azores               |\r\n| I                | Whether or not the date is in daylight saving time.                                                                                                                                                                                 | 1 if Daylight Saving Time, 0 otherwise  |\r\n| O                | Difference to Greenwich time (GMT) without colon between hours and minutes.                                                                                                                                                         | +0200                                   |\r\n| P                | Difference to Greenwich time (GMT) with colon between hours and minutes                                                                                                                                                             | +02:00                                  |\r\n| p                | The same as P, but returns Z instead of +00:00.                                                                                                                                                                                     | +02:00                                  |\r\n| T                | Timezone abbreviation, if known; otherwise the GMT offset.                                                                                                                                                                          | EST, MDT, +05                           |\r\n| Z                | Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive.                                                                                                  | -43200 through 50400                    |\r\n| c                | ISO 8601 date.                                                                                                                                                                                                                      | 2004-02-12T15:19:21+00:00               |\r\n| r                | Seconds since the Unix Epoch.                                                                                                                                                                                                       | January 1 1970 00:00:00 GMT             |\r\n| U                | RFC 2822/RFC 5322 formatted date.                                                                                                                                                                                                   | Thu, 21 Dec 2000 16:01:07 +0200         |\r\n\r\n##### Limitations\r\n\r\nMicroseconds (`u`) are not supported due to JavaScript's Date object limitations.\r\n\r\n#### toDateString\r\n\r\nFormat the instance as date.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toDateString();\r\n\r\nconsole.log(carbon); // 2024-03-01\r\n```\r\n\r\n#### toFormattedDateString\r\n\r\nFormat the instance as a formatted date.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toFormattedDateString();\r\n\r\nconsole.log(carbon); // Mar 1, 2024\r\n```\r\n\r\n#### toFormattedDayDateString\r\n\r\nFormat the instance with the day and a formatted date.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toFormattedDayDateString();\r\n\r\nconsole.log(carbon); // Fri, Mar 1, 2024\r\n```\r\n\r\n#### toTimeString\r\n\r\nFormat the instance as time.\r\n\r\n###### Parameters\r\n\r\n- **precision** *(optional)* - A string representing given unit precision. Defaults to `second`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toTimeString('millisecond');\r\n\r\nconsole.log(carbon); // 12:45:00.000\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toTimeString('second');\r\n\r\nconsole.log(carbon); // 12:45:00\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toTimeString('minute');\r\n\r\nconsole.log(carbon); // 12:45\r\n```\r\n\r\n#### toDateTimeString\r\n\r\nFormat the instance as date and time.\r\n\r\n###### Parameters\r\n\r\n- **precision** *(optional)* - A string representing given unit precision. Defaults to `second`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toDateTimeString('millisecond');\r\n\r\nconsole.log(carbon); // 2024-03-01 12:45:00.000\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toDateTimeString('second');\r\n\r\nconsole.log(carbon); // 2024-03-01 12:45:00\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toDateTimeString('minute');\r\n\r\nconsole.log(carbon); // 2024-03-01 12:45\r\n```\r\n\r\n#### toDateTimeLocalString\r\n\r\nFormat the instance as date and time T-separated with no timezone.\r\n\r\n###### Parameters\r\n\r\n- **precision** *(optional)* - A string representing given unit precision. Defaults to `second`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toDateTimeLocalString('millisecond');\r\n\r\nconsole.log(carbon); // 2024-03-01T12:45:00.000\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toDateTimeLocalString('second');\r\n\r\nconsole.log(carbon); // 2024-03-01T12:45:00\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toDateTimeLocalString('minute');\r\n\r\nconsole.log(carbon); // 2024-03-01T12:45\r\n```\r\n\r\n#### toDayDateTimeString\r\n\r\nFormat the instance with day, date and time.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toDayDateTimeString();\r\n\r\nconsole.log(carbon); // Fri, Mar 1, 2024 12:45 PM\r\n```\r\n\r\n#### toAtomString\r\n\r\nFormat the instance as ATOM.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toAtomString();\r\n\r\nconsole.log(carbon); // 2024-03-01T12:45:00+01:00\r\n```\r\n\r\n#### toCookieString\r\n\r\nFormat the instance as COOKIE.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toCookieString();\r\n\r\nconsole.log(carbon); // Friday, 01-Mar-2024 12:45:00 CET\r\n```\r\n\r\n#### toIsoString\r\n\r\nFormat the instance as ISO8601.\r\n\r\n###### Parameters\r\n\r\n- **keepOffset** *(optional)* - Pass true to keep the date offset, else forced to UTC. Defaults to `false`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toIsoString();\r\n\r\nconsole.log(carbon); // 2024-03-01T11:45:00.000Z\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toIsoString(true);\r\n\r\nconsole.log(carbon); // 2024-03-01T12:45:00.000+01:00\r\n```\r\n\r\n#### toIso8601String\r\n\r\nFormat the instance as ISO8601.\r\n\r\n###### Parameters\r\n\r\n- **extended** *(optional)* - Determine whether to return extended format standard for Date and Time on the Internet.\r\n  Defaults to `false`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toIso8601String();\r\n\r\nconsole.log(carbon); // 2024-03-01T12:45:00+0100\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toIso8601String(true);\r\n\r\nconsole.log(carbon); // +2024-03-01T12:45:00+01:00\r\n```\r\n\r\n#### toIso8601ZuluString\r\n\r\nConvert the instance to UTC and return as Zulu ISO8601.\r\n\r\n###### Parameters\r\n\r\n- **precision** *(optional)* - A string representing given unit precision. Defaults to `second`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toIso8601ZuluString('millisecond');\r\n\r\nconsole.log(carbon); // 2024-03-01T11:45:00.000Z\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toIso8601ZuluString('second');\r\n\r\nconsole.log(carbon); // 2024-03-01T11:45:00Z\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toIso8601ZuluString('minute');\r\n\r\nconsole.log(carbon); // 2024-03-01T11:45Z\r\n```\r\n\r\n#### toRfc822String\r\n\r\nFormat the instance as RFC822.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toRfc822String();\r\n\r\nconsole.log(carbon); // Fri, 01 Mar 24 12:45:00 +0100\r\n```\r\n\r\n#### toRfc850String\r\n\r\nFormat the instance as RFC850.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toRfc850String();\r\n\r\nconsole.log(carbon); // Friday, 01-Mar-24 12:45:00 CET\r\n```\r\n\r\n#### toRfc1036String\r\n\r\nFormat the instance as RFC1036.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toRfc1036String();\r\n\r\nconsole.log(carbon); // Fri, 01 Mar 24 12:45:00 +0100\r\n```\r\n\r\n#### toRfc1123String\r\n\r\nFormat the instance as RFC1123.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toRfc1123String();\r\n\r\nconsole.log(carbon); // Fri, 01 Mar 2024 12:45:00 +0100\r\n```\r\n\r\n#### toRfc2822String\r\n\r\nFormat the instance as RFC2822.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toRfc2822String();\r\n\r\nconsole.log(carbon); // Fri, 01 Mar 2024 12:45:00 +0100\r\n```\r\n\r\n#### toRfc3339String\r\n\r\nFormat the instance as RFC3339.\r\n\r\n###### Parameters\r\n\r\n- **extended** *(optional)* - Determine whether to return extended format standard for Date and Time on the Internet.\r\n  Defaults to `false`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toRfc3339String();\r\n\r\nconsole.log(carbon); // 2024-03-01T12:45:00+01:00\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toRfc3339String(true);\r\n\r\nconsole.log(carbon); // 2024-03-01T12:45:00.000+01:00\r\n```\r\n\r\n#### toRfc7231String\r\n\r\nFormat the instance as RFC7231.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toRfc7231String();\r\n\r\nconsole.log(carbon); // Fri, 01 Mar 2024 11:45:00 GMT\r\n```\r\n\r\n#### toRssString\r\n\r\nFormat the instance as RSS.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toRssString();\r\n\r\nconsole.log(carbon); // Fri, 01 Mar 2024 12:45:00 +0100\r\n```\r\n\r\n#### toW3cString\r\n\r\nFormat the instance as W3C.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toW3cString();\r\n\r\nconsole.log(carbon); // 2024-03-01T12:45:00+01:00\r\n```\r\n\r\n#### getTimeFormatByPrecision\r\n\r\nReturn a format from H:i to H:i:s.u according to given unit precision.\r\n\r\n###### Parameters\r\n\r\n- **precision** *(optional)* - A string representing given unit precision. Defaults to `second`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.now().getTimeFormatByPrecision('millisecond');\r\n\r\nconsole.log(carbon); // H:i:s.v\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.now().getTimeFormatByPrecision('second');\r\n\r\nconsole.log(carbon); // H:i:s\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.now().getTimeFormatByPrecision('minute');\r\n\r\nconsole.log(carbon); // H:i\r\n```\r\n\r\n#### toObject\r\n\r\nGet default object representation.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toObject();\r\n\r\nconsole.log(carbon);\r\n```\r\n\r\n```json\r\n{\r\n    \"year\"     : 2024,\r\n    \"month\"    : 3,\r\n    \"day\"      : 1,\r\n    \"dayOfWeek\": 5,\r\n    \"dayOfYear\": 61,\r\n    \"hour\"     : 12,\r\n    \"minute\"   : 45,\r\n    \"second\"   : 0,\r\n    \"micro\"    : undefined,\r\n    \"timestamp\": 1709293500,\r\n    \"formatted\": \"2024-03-01 12:45:00\",\r\n    \"timezone\" : \"CET (+01:00)\"\r\n}\r\n```\r\n\r\n#### toJson\r\n\r\nReturn the ISO-8601 string with UTC timezone.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toJson();\r\n\r\nconsole.log(carbon); // 2024-03-01T11:45:00.000Z\r\n```\r\n\r\n#### toDate\r\n\r\nReturn native Date object matching the current instance.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toDate();\r\n\r\nconsole.log(carbon); // Date: \"2024-03-01T11:45:00.000Z\" \r\n```\r\n\r\n#### toString\r\n\r\nFormat the instance as a string.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-01 12:45:00', 'CET').toString();\r\n\r\nconsole.log(carbon); // 2024-03-01 12:45:00.000 CET (+01:00)\r\n```\r\n\r\n### Comparison\r\n\r\nCompare dates and times with precision and ease, utilizing Carbon's powerful comparison methods.\r\n\r\n#### isLocal\r\n\r\nDetermines if the instance's date and time are in the local timezone.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.now().isLocal();\r\n\r\nconsole.log(carbon); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.now('UTC').isLocal();\r\n\r\nconsole.log(carbon); // false\r\n```\r\n\r\n> **Note:** In the provided example, the local timezone is Central European Standard Time (CET). Therefore, the example\r\n> returns `true`, indicating that the Carbon instance's date and time are indeed in the local timezone.\r\n\r\n#### isUtc\r\n\r\nDetermines if the instance's date and time are in the UTC timezone.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.now('UTC').isUtc();\r\n\r\nconsole.log(carbon); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.now().isUtc();\r\n\r\nconsole.log(carbon); // false\r\n```\r\n\r\n> **Note:** In the provided example, if the Carbon instance is created with the 'UTC' timezone, then `isUtc()`\r\n> returns `true`, indicating that the date and time are indeed in the UTC timezone. Conversely, if the instance is\r\n> created\r\n> without specifying 'UTC' (thus using the local timezone, which is Central European Standard Time (CET) in this\r\n> case), `isUtc()` returns `false`.\r\n\r\n#### isValid\r\n\r\nDetermines if the instance's date and time is valid.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14');\r\n\r\nconsole.log(carbon.isValid()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('invalid date');\r\n\r\nconsole.log(carbon.isValid()); // false\r\n```\r\n\r\n#### isDst\r\n\r\nDetermines if the instance's date and time is in daylight saving time.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-07-14');\r\n\r\nconsole.log(carbon.isDst()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14');\r\n\r\nconsole.log(carbon.isDst()); // false\r\n```\r\n\r\n#### isLeapYear\r\n\r\nDetermines if the instance is a leap year.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14');\r\n\r\nconsole.log(carbon.isLeapYear()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2023-03-14');\r\n\r\nconsole.log(carbon.isLeapYear()); // false\r\n```\r\n\r\n#### isMonday\r\n\r\nDetermines if the instance's day is Monday.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-01');\r\n\r\nconsole.log(carbon.isMonday()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-02');\r\n\r\nconsole.log(carbon.isMonday()); // false\r\n```\r\n\r\n#### isTuesday\r\n\r\nDetermines if the instance's day is Tuesday.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-02');\r\n\r\nconsole.log(carbon.isTuesday()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-03');\r\n\r\nconsole.log(carbon.isTuesday()); // false\r\n```\r\n\r\n#### isWednesday\r\n\r\nDetermines if the instance's day is Wednesday.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-03');\r\n\r\nconsole.log(carbon.isWednesday()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-04');\r\n\r\nconsole.log(carbon.isWednesday()); // false\r\n```\r\n\r\n#### isThursday\r\n\r\nDetermines if the instance's day is Thursday.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-04');\r\n\r\nconsole.log(carbon.isThursday()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-05');\r\n\r\nconsole.log(carbon.isThursday()); // false\r\n```\r\n\r\n#### isFriday\r\n\r\nDetermines if the instance's day is Friday.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-05');\r\n\r\nconsole.log(carbon.isFriday()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-06');\r\n\r\nconsole.log(carbon.isFriday()); // false\r\n```\r\n\r\n#### isSaturday\r\n\r\nDetermines if the instance's day is Saturday.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-06');\r\n\r\nconsole.log(carbon.isSaturday()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-07');\r\n\r\nconsole.log(carbon.isSaturday()); // false\r\n```\r\n\r\n#### isSunday\r\n\r\nDetermines if the instance's day is Sunday.\r\n\r\n###### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-07');\r\n\r\nconsole.log(carbon.isSunday()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-08');\r\n\r\nconsole.log(carbon.isSunday()); // false\r\n```\r\n\r\n#### isWeekday\r\n\r\nDetermines if the instance is a weekday.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14');\r\n\r\nconsole.log(carbon.isWeekday()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-17');\r\n\r\nconsole.log(carbon.isWeekday()); // false\r\n```\r\n\r\n#### isWeekend\r\n\r\nDetermines if the instance is a weekend day.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16');\r\n\r\nconsole.log(carbon.isWeekend()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14');\r\n\r\nconsole.log(carbon.isWeekend()); // false\r\n```\r\n\r\n#### isYesterday\r\n\r\nDetermines if the instance is yesterday.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14');\r\n\r\nconsole.log(carbon.isYesterday()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-15');\r\n\r\nconsole.log(carbon.isYesterday()); // false\r\n```\r\n\r\n> **Note:** These examples assume that \"today\" is 2024-03-15.\r\n\r\n#### isToday\r\n\r\nDetermines if the instance is today.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-15');\r\n\r\nconsole.log(carbon.isToday()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14');\r\n\r\nconsole.log(carbon.isToday()); // false\r\n```\r\n\r\n> **Note:** These examples assume that \"today\" is 2024-03-15.\r\n\r\n#### isTomorrow\r\n\r\nDetermines if the instance is tomorrow.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16');\r\n\r\nconsole.log(carbon.isTomorrow()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-15');\r\n\r\nconsole.log(carbon.isTomorrow()); // false\r\n```\r\n\r\n> **Note:** These examples assume that \"today\" is 2024-03-15.\r\n\r\n#### isDayOfWeek\r\n\r\nDetermines if the instance is a specific day of the week.\r\n\r\n##### Parameters\r\n\r\n- **day** - The day of the week as number or string. Property is case-insensitive when provided as a string.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14');\r\n\r\nconsole.log(carbon.isDayOfWeek('thursday')); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14');\r\n\r\nconsole.log(carbon.isDayOfWeek(2)); // false\r\n```\r\n\r\n#### isBirthday\r\n\r\nDetermines if the instance is the birthday, comparing only the month and day.\r\n\r\n##### Parameters\r\n\r\n- **date** *(optional)* - The date to compare against, which can be a `Carbon` instance, a string date, or `null`.\r\n  Defaults to `null`.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon   = Carbon.parse('2024-03-14');\r\nconst birthday = Carbon.parse('2000-03-14');\r\n\r\nconsole.log(carbon.isBirthday(birthday)); // true\r\n```\r\n\r\n```javascript\r\nconst carbon   = Carbon.parse('2024-03-14');\r\nconst birthday = Carbon.parse('1995-04-22');\r\n\r\nconsole.log(carbon.isBirthday(birthday)); // false\r\n```\r\n\r\n#### isLastOfMonth\r\n\r\nDetermines if today is the last day of the month.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-02-29');\r\n\r\nconsole.log(carbon.isLastOfMonth()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-02-28');\r\n\r\nconsole.log(carbon.isLastOfMonth()); // false\r\n```\r\n\r\n#### isStartOfDay\r\n\r\nDetermines if the instance is at the start of the day.\r\n\r\n##### Parameters\r\n\r\n- **checkMilliseconds** *(optional)* - A boolean indicating whether to include milliseconds in the check. Defaults\r\n  to `false`.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14 00:00:00');\r\n\r\nconsole.log(carbon.isStartOfDay()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14 00:00:00.001');\r\n\r\nconsole.log(carbon.isStartOfDay(true)); // false\r\n```\r\n\r\n#### isEndOfDay\r\n\r\nDetermines if the instance is at the end of the day.\r\n\r\n##### Parameters\r\n\r\n- **checkMilliseconds** *(optional)* - A boolean indicating whether to include milliseconds in the check. Defaults\r\n  to `false`.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14 23:59:59');\r\n\r\nconsole.log(carbon.isEndOfDay()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14 23:59:59.999');\r\n\r\nconsole.log(carbon.isEndOfDay(true)); // true\r\n```\r\n\r\n#### isMidnight\r\n\r\nDetermines if the instance is midnight.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14 00:00:00');\r\n\r\nconsole.log(carbon.isMidnight()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14 12:00:00');\r\n\r\nconsole.log(carbon.isMidnight()); // false\r\n```\r\n\r\n#### isMidday\r\n\r\nDetermines if the instance is midday.\r\n\r\n##### Examples\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14 12:00:00');\r\n\r\nconsole.log(carbon.isMidday()); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-14 11:59:59');\r\n\r\nconsole.log(carbon.isMidday()); // false\r\n```\r\n\r\n#### isSameAs\r\n\r\nCompares the formatted values of the two dates.\r\n\r\n###### Parameters\r\n\r\n- **format** *(required)* - A string representing the format of the dates to be compared.\r\n- **date** *(optional)* - An instance of `Carbon`, a `Date` object, a string representing a date, or `null`. Defaults\r\n  to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-10 15:00:00', 'CET');\r\nconst date   = '2024-03-10 15:00:00';\r\n\r\nconsole.log(carbon.isSameAs('Y-m-d H:i:s', date)); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-10 15:00:00', 'CET');\r\nconst date   = Carbon.parse('2024-03-10 16:00:00', 'CET');\r\n\r\nconsole.log(carbon.isSameAs('Y-m-d H:i:s', date)); // false\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-10', 'CET');\r\nconst date   = Carbon.parse('2024-12-25', 'CET');\r\n\r\nconsole.log(carbon.isSameAs('Y', date)); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-10', 'CET');\r\nconst date   = new Date('2024-03-10T00:00:00Z');\r\n\r\nconsole.log(carbon.isSameAs('Y-m-d', date)); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-10 15:00:00', 'CET');\r\nconst date   = '2024-03-10';\r\n\r\nconsole.log(carbon.isSameAs('Y-m-d H:i:s', date)); // false\r\nconsole.log(carbon.isSameAs('Y-m-d', date)); // true\r\n```\r\n\r\n```javascript\r\nconst today = new Carbon();\r\n\r\nconsole.log(today.isSameAs('Y-m-d')); // true\r\n```\r\n\r\n#### isSameYear\r\n\r\nDetermine if the given date is in the same year as the instance. If null passed, compare to now (with the same\r\ntimezone).\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - An instance of `Carbon`, a string representing a date, or `null`. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-01', 'CET');\r\nconst date   = Carbon.parse('2024-12-31', 'CET');\r\n\r\nconsole.log(carbon.isSameYear(date)); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-01', 'CET');\r\nconst date   = Carbon.parse('2025-01-01', 'CET');\r\n\r\nconsole.log(carbon.isSameYear(date)); // false\r\n```\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameYear()); // true\r\n```\r\n\r\n```javascript\r\nconst date = new Date();\r\ndate.setFullYear(date.getFullYear() + 1);\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameYear()); // false\r\n```\r\n\r\n#### isCurrentYear\r\n\r\nDetermine if the instance is in the same year as the current moment.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentYear()); // true\r\n```\r\n\r\n```javascript\r\nconst date = new Date();\r\ndate.setFullYear(date.getFullYear() + 1);\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentYear()); // false\r\n```\r\n\r\n#### isNextYear\r\n\r\nDetermine if the instance is in the same year as the current moment next year.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst nextYear = new Date();\r\nnextYear.setFullYear(nextYear.getFullYear() + 1);\r\nconst carbon = Carbon.parse(nextYear.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isNextYear()); // true\r\n```\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isNextYear()); // false\r\n```\r\n\r\n#### isLastYear\r\n\r\nDetermine if the instance is in the same year as the current moment last year.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst lastYear = new Date();\r\nlastYear.setFullYear(lastYear.getFullYear() - 1);\r\nconst carbon = Carbon.parse(lastYear.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isLastYear()); // true\r\n```\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isLastYear()); // false\r\n```\r\n\r\n#### isSameMonth\r\n\r\nDetermine if the given date is in the same month as the instance. If null passed, compare to now (with the same\r\ntimezone).\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - An instance of `Carbon`, a string representing a date, or `null`. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-15', 'CET');\r\nconst date   = Carbon.parse('2024-01-31', 'CET');\r\n\r\nconsole.log(carbon.isSameMonth(date)); // true\r\n```\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-01-01', 'CET');\r\nconst date   = Carbon.parse('2024-02-01', 'CET');\r\n\r\nconsole.log(carbon.isSameMonth(date)); // false\r\n```\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameMonth()); // true\r\n```\r\n\r\n```javascript\r\nconst date = new Date();\r\ndate.setMonth(date.getMonth() + 1);\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameMonth()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m'.\r\n\r\n#### isCurrentMonth\r\n\r\nDetermine if the instance is in the same month as the current moment.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentMonth()); // true\r\n```\r\n\r\n```javascript\r\nconst date = new Date();\r\ndate.setMonth(date.getMonth() - 1);\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentMonth()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m'.\r\n\r\n#### isNextMonth\r\n\r\nDetermine if the instance is in the same month as the current moment next month.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst nextMonth = new Date();\r\nnextMonth.setMonth(nextMonth.getMonth() + 1);\r\nconst carbon = Carbon.parse(nextMonth.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isNextMonth()); // true\r\n```\r\n\r\n```javascript\r\nconst date = Carbon.now();\r\n\r\nconsole.log(date.isNextMonth()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m'.\r\n\r\n#### isLastMonth\r\n\r\nDetermine if the instance is in the same month as the current moment last month.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst lastMonth = new Date();\r\nlastMonth.setMonth(lastMonth.getMonth() - 1);\r\nconst carbon = Carbon.parse(lastMonth.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isLastMonth()); // true\r\n```\r\n\r\n```javascript\r\nconst date = Carbon.now();\r\n\r\nconsole.log(date.isLastMonth()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m'.\r\n\r\n#### isSameWeek\r\n\r\nDetermine if the given date is in the same week as the instance. If null passed, compare to now (with the same\r\ntimezone).\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - An instance of `Carbon`, a string representing a date, or `null`. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst startOfWeek = Carbon.parse('2024-03-04', 'CET');\r\nconst endOfWeek   = Carbon.parse('2024-03-10', 'CET');\r\n\r\nconsole.log(startOfWeek.isSameWeek(endOfWeek)); // true\r\n```\r\n\r\n```javascript\r\nconst startOfWeek = Carbon.parse('2024-03-04', 'CET');\r\nconst nextWeek    = Carbon.parse('2024-03-11', 'CET');\r\n\r\nconsole.log(startOfWeek.isSameWeek(nextWeek)); // false\r\n```\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameWeek()); // true\r\n```\r\n\r\n```javascript\r\nconst nextWeek = new Date();\r\nnextWeek.setDate(nextWeek.getDate() + 7);\r\n\r\nconst carbon = Carbon.parse(nextWeek.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameWeek()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'o-W'.\r\n\r\n#### isCurrentWeek\r\n\r\nDetermine if the instance is in the same week as the current moment.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now    = new Date();\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentWeek()); // true\r\n```\r\n\r\n```javascript\r\nconst now = new Date();\r\nnow.setDate(now.getDate() + 7);\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentWeek()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'o-W'.\r\n\r\n#### isNextWeek\r\n\r\nDetermine if the instance is in the same week as the current moment next week.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now      = new Date();\r\nconst nextWeek = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 7);\r\nconst carbon   = Carbon.parse(nextWeek.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isNextWeek()); // true if in the same week as next week, false otherwise\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isNextWeek()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'o-W'.\r\n\r\n#### isLastWeek\r\n\r\nDetermine if the instance is in the same week as the current moment last week.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now      = new Date();\r\nconst lastWeek = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 7);\r\nconst carbon   = Carbon.parse(lastWeek.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isLastWeek()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isLastWeek()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'o-W'.\r\n\r\n#### isSameDay\r\n\r\nDetermine if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - An instance of `Carbon`, a string representing a date, or `null`. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameDay()); // true\r\n```\r\n\r\n```javascript\r\nconst nextDay = new Date();\r\nnextDay.setDate(nextDay.getDate() + 1);\r\n\r\nconst carbon = Carbon.parse(nextDay.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameDay()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d'.\r\n\r\n#### isCurrentDay\r\n\r\nDetermine if the instance is in the same day as the current moment.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now    = new Date();\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentDay()); // true\r\n```\r\n\r\n```javascript\r\nconst now = new Date();\r\nnow.setDate(now.getDate() + 1);\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentDay()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d'.\r\n\r\n#### isNextDay\r\n\r\nDetermine if the instance is in the same day as the current moment next day.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now     = new Date();\r\nconst nextDay = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);\r\nconst carbon  = Carbon.parse(nextDay.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isNextDay()); // true if in the same day as next day, false otherwise\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isNextDay()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d'.\r\n\r\n#### isLastDay\r\n\r\nDetermine if the instance is in the same day as the current moment last day.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now     = new Date();\r\nconst lastDay = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1);\r\nconst carbon  = Carbon.parse(lastDay.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isLastDay()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isLastDay()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d'.\r\n\r\n#### isSameHour\r\n\r\nDetermine if the given date is in the same hour as the instance. If null passed, compare to now (with the same\r\ntimezone).\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - An instance of `Carbon`, a string representing a date, or `null`. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameHour()); // true\r\n```\r\n\r\n```javascript\r\nconst nextHour = new Date();\r\nnextHour.setHours(nextHour.getHours() + 1);\r\n\r\nconst carbon = Carbon.parse(nextHour.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameHour()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d H'.\r\n\r\n#### isCurrentHour\r\n\r\nDetermine if the instance is in the same hour as the current moment.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now    = new Date();\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentHour()); // true\r\n```\r\n\r\n```javascript\r\nconst now = new Date();\r\nnow.setHours(now.getHours() + 1);\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentHour()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d H'.\r\n\r\n#### isNextHour\r\n\r\nDetermine if the instance is in the same hour as the current moment next hour.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now      = new Date();\r\nconst nextHour = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours() + 1);\r\nconst carbon   = Carbon.parse(nextHour.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isNextHour()); // true if in the same hour as next hour, false otherwise\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isNextHour()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d H'.\r\n\r\n#### isLastHour\r\n\r\nDetermine if the instance is in the same hour as the current moment last hour.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now      = new Date();\r\nconst lastHour = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours() - 1);\r\nconst carbon   = Carbon.parse(lastHour.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isLastHour()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isLastHour()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d H'.\r\n\r\n#### isSameMinute\r\n\r\nDetermine if the given date is in the same minute as the instance. If null passed, compare to now (with the same\r\ntimezone).\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - An instance of `Carbon`, a string representing a date, or `null`. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameMinute()); // true\r\n```\r\n\r\n```javascript\r\nconst nextMinute = new Date();\r\nnextMinute.setMinutes(nextMinute.getMinutes() + 1);\r\n\r\nconst carbon = Carbon.parse(nextMinute.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameMinute()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d H:i'.\r\n\r\n#### isCurrentMinute\r\n\r\nDetermine if the instance is in the same minute as the current moment.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now    = new Date();\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentMinute()); // true\r\n```\r\n\r\n```javascript\r\nconst now = new Date();\r\nnow.setMinutes(now.getMinutes() + 1);\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentMinute()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d H:i'.\r\n\r\n#### isNextMinute\r\n\r\nDetermine if the instance is in the same minute as the current moment next minute.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now        = new Date();\r\nconst nextMinute = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes() + 1);\r\nconst carbon     = Carbon.parse(nextMinute.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isNextMinute()); // true if in the same minute as next minute, false otherwise\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isNextMinute()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d H:i'.\r\n\r\n#### isLastMinute\r\n\r\nDetermine if the instance is in the same minute as the current moment last minute.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now        = new Date();\r\nconst lastMinute = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes() - 1);\r\nconst carbon     = Carbon.parse(lastMinute.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isLastMinute()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isLastMinute()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d H:i'.\r\n\r\n#### isSameMillisecond\r\n\r\nDetermine if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same\r\ntimezone).\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - An instance of `Carbon`, a string representing a date, or `null`. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameMillisecond()); // true\r\n```\r\n\r\n```javascript\r\nconst nextMillisecond = new Date();\r\nnextMillisecond.setMilliseconds(nextMillisecond.getMilliseconds() + 1);\r\n\r\nconst carbon = Carbon.parse(nextMillisecond.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameMillisecond()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d H:i:s.v'.\r\n\r\n#### isCurrentMillisecond\r\n\r\nDetermine if the instance is in the same millisecond as the current moment.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now    = new Date();\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentMillisecond()); // true\r\n```\r\n\r\n```javascript\r\nconst now = new Date();\r\nnow.setMilliseconds(now.getMilliseconds() + 1);\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentMillisecond()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d H:i:s.v'.\r\n\r\n#### isNextMillisecond\r\n\r\nDetermine if the instance is in the same millisecond as the current moment next millisecond.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now             = new Date();\r\nconst nextMillisecond = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds() + 1);\r\nconst carbon          = Carbon.parse(nextMillisecond.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isNextMillisecond()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isNextMillisecond()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d H:i:s.v'.\r\n\r\n#### isLastMillisecond\r\n\r\nDetermine if the instance is in the same millisecond as the current moment last millisecond.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now             = new Date();\r\nconst lastMillisecond = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds() - 1);\r\nconst carbon          = Carbon.parse(lastMillisecond.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isLastMillisecond()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isLastMillisecond()); // false\r\n```\r\n\r\n> **Notice:** The comparison is based on the format 'Y-m-d H:i:s.v'.\r\n\r\n#### isSameQuarter\r\n\r\nDetermine if the given date is in the same quarter as the instance. If null passed, compare to now (with the same\r\ntimezone).\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - An instance of `Carbon`, a string representing a date, or `null`. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameQuarter()); // true\r\n```\r\n\r\n```javascript\r\nconst nextQuarter = new Date();\r\nnextQuarter.setMonth(nextQuarter.getMonth() + 3);\r\n\r\nconst carbon = Carbon.parse(nextQuarter.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameQuarter()); // false\r\n```\r\n\r\n#### isCurrentQuarter\r\n\r\nDetermine if the instance is in the same quarter as the current moment.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now    = new Date();\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentQuarter()); // true\r\n```\r\n\r\n```javascript\r\nconst now = new Date();\r\nnow.setMonth(now.getMonth() + 3);\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentQuarter()); // false\r\n```\r\n\r\n#### isNextQuarter\r\n\r\nDetermine if the instance is in the same quarter as the current moment next quarter.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now         = new Date();\r\nconst nextQuarter = new Date(now.getFullYear(), now.getMonth() + 3, now.getDate());\r\nconst carbon      = Carbon.parse(nextQuarter.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isNextQuarter()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isNextQuarter()); // false\r\n```\r\n\r\n#### isLastQuarter\r\n\r\nDetermine if the instance is in the same quarter as the current moment last quarter.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now         = new Date();\r\nconst lastQuarter = new Date(now.getFullYear(), now.getMonth() - 3, now.getDate());\r\nconst carbon      = Carbon.parse(lastQuarter.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isLastQuarter()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isLastQuarter()); // false\r\n```\r\n\r\n#### isSameDecade\r\n\r\nDetermine if the given date is in the same decade as the instance. If null passed, compare to now (with the same\r\ntimezone).\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - An instance of `Carbon`, a string representing a date, or `null`. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameDecade()); // true\r\n```\r\n\r\n```javascript\r\nconst nextDecade = new Date();\r\nnextDecade.setFullYear(nextDecade.getFullYear() + 10);\r\n\r\nconst carbon = Carbon.parse(nextDecade.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameDecade()); // false\r\n```\r\n\r\n#### isCurrentDecade\r\n\r\nDetermine if the instance is in the same decade as the current moment.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now    = new Date();\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentDecade()); // true\r\n```\r\n\r\n```javascript\r\nconst now = new Date();\r\nnow.setFullYear(now.getFullYear() + 10);\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentDecade()); // false\r\n```\r\n\r\n#### isNextDecade\r\n\r\nDetermine if the instance is in the same decade as the current moment next decade.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now        = new Date();\r\nconst nextDecade = new Date(now.getFullYear() + 10, now.getMonth(), now.getDate());\r\nconst carbon     = Carbon.parse(nextDecade.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isNextDecade()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isNextDecade()); // false\r\n```\r\n\r\n#### isLastDecade\r\n\r\nDetermine if the instance is in the same decade as the current moment last decade.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now        = new Date();\r\nconst lastDecade = new Date(now.getFullYear() - 10, now.getMonth(), now.getDate());\r\nconst carbon     = Carbon.parse(lastDecade.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isLastDecade()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isLastDecade()); // false\r\n```\r\n\r\n#### isSameCentury\r\n\r\nDetermine if the given date is in the same century as the instance. If null passed, compare to now (with the same\r\ntimezone).\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - An instance of `Carbon`, a string representing a date, or `null`. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameCentury()); // true\r\n```\r\n\r\n```javascript\r\nconst nextCentury = new Date();\r\nnextCentury.setFullYear(nextCentury.getFullYear() + 100);\r\n\r\nconst carbon = Carbon.parse(nextCentury.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameCentury()); // false\r\n```\r\n\r\n#### isCurrentCentury\r\n\r\nDetermine if the instance is in the same century as the current moment.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now    = new Date();\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentCentury()); // true\r\n```\r\n\r\n```javascript\r\nconst now = new Date();\r\nnow.setFullYear(now.getFullYear() + 100);\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentCentury()); // false\r\n```\r\n\r\n#### isNextCentury\r\n\r\nDetermine if the instance is in the same century as the current moment next century.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now         = new Date();\r\nconst nextCentury = new Date(now.getFullYear() + 100, now.getMonth(), now.getDate());\r\nconst carbon      = Carbon.parse(nextCentury.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isNextCentury()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isNextCentury()); // false\r\n```\r\n\r\n#### isLastCentury\r\n\r\nDetermine if the instance is in the same century as the current moment last century.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now         = new Date();\r\nconst lastCentury = new Date(now.getFullYear() - 100, now.getMonth(), now.getDate());\r\nconst carbon      = Carbon.parse(lastCentury.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isLastCentury()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isLastCentury()); // false\r\n```\r\n\r\n#### isSameMillennium\r\n\r\nDetermine if the given date is in the same millennium as the instance. If null passed, compare to now (with the same\r\ntimezone).\r\n\r\n###### Parameters\r\n\r\n- **date** *(optional)* - An instance of `Carbon`, a string representing a date, or `null`. Defaults to `null`.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst date   = new Date();\r\nconst carbon = Carbon.parse(date.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameMillennium()); // true\r\n```\r\n\r\n```javascript\r\nconst nextMillennium = new Date();\r\nnextMillennium.setFullYear(nextMillennium.getFullYear() + 1000);\r\n\r\nconst carbon = Carbon.parse(nextMillennium.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isSameMillennium()); // false\r\n```\r\n\r\n#### isCurrentMillennium\r\n\r\nDetermine if the instance is in the same millennium as the current moment.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now    = new Date();\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentMillennium()); // true\r\n```\r\n\r\n```javascript\r\nconst now = new Date();\r\nnow.setFullYear(now.getFullYear() + 1000);\r\nconst carbon = Carbon.parse(now.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isCurrentMillennium()); // false\r\n```\r\n\r\n#### isNextMillennium\r\n\r\nDetermine if the instance is in the same millennium as the current moment next millennium.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now            = new Date();\r\nconst nextMillennium = new Date(now.getFullYear() + 1000, now.getMonth(), now.getDate());\r\nconst carbon         = Carbon.parse(nextMillennium.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isNextMillennium()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isNextMillennium()); // false\r\n```\r\n\r\n#### isLastMillennium\r\n\r\nDetermine if the instance is in the same millennium as the current moment last millennium.\r\n\r\n##### Example\r\n\r\n```javascript\r\nconst now            = new Date();\r\nconst lastMillennium = new Date(now.getFullYear() - 1000, now.getMonth(), now.getDate());\r\nconst carbon         = Carbon.parse(lastMillennium.toISOString(), 'CET');\r\n\r\nconsole.log(carbon.isLastMillennium()); // true\r\n```\r\n\r\n```javascript\r\nconst now = Carbon.now();\r\n\r\nconsole.log(now.isLastMillennium()); // false\r\n```\r\n\r\n### Getters\r\n\r\nRetrieve specific components of a date or time, such as year, month, day, hour, minute, and second, effortlessly with\r\nCarbon's getter functions.\r\n\r\n#### get\r\n\r\nRetrieve specific parts of the Carbon object using various keys.\r\n\r\n##### Example\r\n\r\n###### year\r\n\r\nGet the year.\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16').get('year');\r\n\r\nconsole.log(carbon); // 2024\r\n```\r\n\r\n###### month\r\n\r\nGet the month number (1-12).\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16').get('month');\r\n\r\nconsole.log(carbon); // 3\r\n```\r\n\r\n###### week\r\n\r\nGet the week number of the year.\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16').get('week');\r\n\r\nconsole.log(carbon); // 11\r\n```\r\n\r\n###### day\r\n\r\nGet the day of the month.\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16').get('day');\r\n\r\nconsole.log(carbon); // 16\r\n```\r\n\r\n###### hour\r\n\r\nGet the hour of the day (0-23).\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16 15:00').get('hour');\r\n\r\nconsole.log(carbon); // 15\r\n```\r\n\r\n###### minute\r\n\r\nGet the minute.\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16 15:30').get('minute');\r\n\r\nconsole.log(carbon); // 30\r\n```\r\n\r\n###### second\r\n\r\nGet the second.\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16 15:30:45').get('second');\r\n\r\nconsole.log(carbon); // 45\r\n```\r\n\r\n###### millisecond\r\n\r\nGet the millisecond.\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16 12:00:00.123').get('millisecond');\r\n\r\nconsole.log(carbon);  // 123\r\n```\r\n\r\n###### timestamp\r\n\r\nGet the Unix timestamp.\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16 12:00:00').get('timestamp');\r\n\r\nconsole.log(carbon); // 1710586800 \r\n```\r\n\r\n###### dayOfWeek\r\n\r\nGet the day of the week (0 for Sunday, 6 for Saturday).\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16').get('dayOfWeek');\r\n\r\nconsole.log(carbon); // 6\r\n```\r\n\r\n###### dayOfYear\r\n\r\nGet the day of the year (1-365/366).\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16').get('dayOfYear');\r\n\r\nconsole.log(carbon); // 76\r\n```\r\n\r\n###### daysInMonth\r\n\r\nGet the number of days in the given month.\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-02').get('daysInMonth');\r\n\r\nconsole.log(carbon); // 29\r\n```\r\n\r\n###### quarter\r\n\r\nGet the quarter of the year (1-4).\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16').get('quarter');\r\n\r\nconsole.log(carbon); // 1\r\n```\r\n\r\n###### decade\r\n\r\nGet the decade.\r\n\r\n```javascript\r\nconst carbon = Carbon.parse('2024-03-16').get('decade');\r\n\r\nconsole.log(carbon); // 203\r\n```\r\n\r\n###### century\r\n\r\nGet the century.\r\n\r\n```javascript\r\nconst c","readmeFilename":"README.md"}