{"id":21467457,"url":"https://github.com/elusivecodes/frostdatetime","last_synced_at":"2026-02-26T09:03:42.483Z","repository":{"id":57242083,"uuid":"138694571","full_name":"elusivecodes/FrostDateTime","owner":"elusivecodes","description":"FrostDateTime is a free, open-source date manipulation library for JavaScript.","archived":false,"fork":false,"pushed_at":"2025-05-09T05:47:30.000Z","size":1319,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-24T16:04:36.801Z","etag":null,"topics":["date","datetime","format","icu","javascript","locale","localization","parse","time","timezone"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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,"zenodo":null}},"created_at":"2018-06-26T06:32:09.000Z","updated_at":"2025-05-09T05:47:14.000Z","dependencies_parsed_at":"2023-11-29T03:24:37.477Z","dependency_job_id":"5c152255-e75b-446a-8d25-639337ad0c09","html_url":"https://github.com/elusivecodes/FrostDateTime","commit_stats":{"total_commits":129,"total_committers":4,"mean_commits":32.25,"dds":0.03100775193798455,"last_synced_commit":"374c1685cdcaf03f8cd0c779875954a52a44575a"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/elusivecodes/FrostDateTime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFrostDateTime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFrostDateTime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFrostDateTime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFrostDateTime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elusivecodes","download_url":"https://codeload.github.com/elusivecodes/FrostDateTime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFrostDateTime/sbom","scorecard":{"id":374091,"data":{"date":"2025-08-11","repo":{"name":"github.com/elusivecodes/FrostDateTime","commit":"26e4e9556d1ec1ad7c00b6fd83a34747b222605d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T13:46:18.303Z","repository_id":57242083,"created_at":"2025-08-18T13:46:18.303Z","updated_at":"2025-08-18T13:46:18.303Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274046000,"owners_count":25212982,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","javascript","locale","localization","parse","time","timezone"],"created_at":"2024-11-23T08:18:10.936Z","updated_at":"2026-02-26T09:03:42.391Z","avatar_url":"https://github.com/elusivecodes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FrostDateTime\r\n\r\n**FrostDateTime** is a free, open-source immutable date manipulation library for *JavaScript*.\r\n\r\nIt is a lightweight (~7kb gzipped) and 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- [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**In Browser**\r\n\r\n```html\r\n\u003cscript type=\"text/javascript\" src=\"/path/to/frost-datetime.min.js\"\u003e\u003c/script\u003e\r\n```\r\n\r\n**Using NPM**\r\n\r\n```\r\nnpm i @fr0st/datetime\r\n```\r\n\r\nIn Node.js:\r\n\r\n```javascript\r\nimport DateTime from '@fr0st/datetime';\r\n```\r\n\r\n\r\n## Date Creation\r\n\r\n- `dateString` is a string representing the date, and will default to the current timestamp.\r\n- `options` is an object containing options for creating the new date.\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```javascript\r\nconst dateTime = new DateTime(dateString, options);\r\n```\r\n\r\n**From Array**\r\n\r\n- `dateArray` is an array containing the year, month, date, hours, minutes, seconds and milliseconds.\r\n- `options` is an object containing options for creating the new date.\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```javascript\r\nconst dateTime = DateTime.fromArray(dateArray, options);\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**From Date**\r\n\r\n- `dateObj` is a native JS *Date* object.\r\n- `options` is an object containing options for creating the new date.\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```javascript\r\nconst dateTime = DateTime.fromDate(dateObj, options);\r\n```\r\n\r\n**From Format**\r\n\r\nIf you wish to parse a date string and you know the exact format, you can use the `fromFormat` static method.\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- `options` is an object containing options for creating the new date.\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 a subset of the ICU specification described in [Formats](Formats.md).\r\n\r\nThe `isValid` property on the created *DateTime* object can be used to determine whether a formatted string was a valid date.\r\n\r\n```javascript\r\nconst dateTime = DateTime.fromFormat(formatString, dateString, options);\r\n```\r\n\r\n**From ISO String**\r\n\r\n- `dateString` is a string representing the date you are parsing.\r\n- `options` is an object containing options for creating the new date.\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 English.\r\n\r\nThe `dateString` must be in *yyyy-MM-dd'T'HH:mm:ss.SSSxxx*\" format and in English.\r\n\r\nIf the `timeZone` option is also passed, the created *DateTime* will be converted to the new `timeZone`.\r\n\r\nThe `isValid` property on the created *DateTime* object can be used to determine whether a formatted string was a valid date.\r\n\r\n```javascript\r\nconst dateTime = DateTime.fromISOString(dateString, options);\r\n```\r\n\r\n**From Timestamp**\r\n\r\n- `timestamp` is the number of seconds since the UNIX epoch.\r\n- `options` is an object containing options for creating the new date.\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```javascript\r\nconst dateTime = DateTime.fromTimestamp(timestamp, options);\r\n```\r\n\r\n**Now**\r\n\r\n- `options` is an object containing options for creating the new date.\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```javascript\r\nconst dateTime = DateTime.now(options);\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 a subset of the ICU specification described in [Formats](Formats.md).\r\n\r\n```javascript\r\nconst dateString = dateTime.format(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```javascript\r\nconst string = dateTime.toString();\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```javascript\r\nconst dateString = dateTime.toDateString();\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```javascript\r\nconst isoString = dateTime.toISOString();\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```javascript\r\nconst timeString = dateTime.toTimeString();\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```javascript\r\nconst utcString = dateTime.toUTCString();\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```javascript\r\nconst date = dateTime.getDate();\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```javascript\r\nconst day = dateTime.getDay();\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```javascript\r\nconst dayOfYear = dateTime.getDayOfYear();\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```javascript\r\nconst month = dateTime.getMonth();\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```javascript\r\nconst quarter = dateTime.getQuarter();\r\n```\r\n\r\n**Get Year**\r\n\r\nGet the year in current time zone.\r\n\r\n```javascript\r\nconst year = dateTime.getYear();\r\n```\r\n\r\n**Set Date**\r\n\r\nSet the date in current time zone.\r\n\r\n- `date` is a number representing the date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.setDate(date);\r\n```\r\n\r\n**Set Day**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setDay(day);\r\n```\r\n\r\n**Set Day Of Year**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setDayOfYear(dayOfYear);\r\n```\r\n\r\n**Set Month**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setMonth(month, date);\r\n```\r\n\r\n**Set Quarter**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setQuarter(quarter);\r\n```\r\n\r\n**Set Year**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setYear(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```javascript\r\nconst week = dateTime.getWeek();\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```javascript\r\nconst weekDay = dateTime.getWeekDay();\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```javascript\r\nconst weekDayInMonth = dateTime.getWeekDayInMonth();\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```javascript\r\nconst weekOfMonth = dateTime.getWeekOfMonth();\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```javascript\r\nconst weekYear = dateTime.getWeekYear();\r\n```\r\n\r\n**Set Week**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setWeek(week, weekDay);\r\n```\r\n\r\n**Set Week Day**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setWeekDay(weekDay);\r\n```\r\n\r\n**Set Week Day In Month**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setWeekDayInMonth(weekDayInMonth);\r\n```\r\n\r\n**Set Week Of Month**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setWeekOfMonth(weekOfMonth);\r\n```\r\n\r\n**Set Week Year**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setWeekYear(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```javascript\r\nconst hours = dateTime.getHours();\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```javascript\r\nconst milliseconds = dateTime.getMilliseconds();\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```javascript\r\nconst minutes = dateTime.getMinutes();\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```javascript\r\nconst seconds = dateTime.getSeconds();\r\n```\r\n\r\n**Set Hours**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setHours(hours, minutes, seconds, milliseconds);\r\n```\r\n\r\n**Set Milliseconds**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setMilliseconds(milliseconds);\r\n```\r\n\r\n**Set Minutes**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setMinutes(minutes, seconds, milliseconds);\r\n```\r\n\r\n**Set Seconds**\r\n\r\nSet the 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```javascript\r\nconst newDateTime = dateTime.setSeconds(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```javascript\r\nconst time = dateTime.getTime();\r\n```\r\n\r\n**Get Seconds**\r\n\r\nGet the number of seconds since the UNIX epoch.\r\n\r\n```javascript\r\nconst timestamp = dateTime.getTimestamp();\r\n```\r\n\r\n**Set Milliseconds**\r\n\r\nSet the number of milliseconds since the UNIX epoch.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.setTime(time);\r\n```\r\n\r\n**Set Seconds**\r\n\r\nSet the number of seconds since the UNIX epoch.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.setTimestamp(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```javascript\r\nconst timeZone = dateTime.getTimeZone();\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```javascript\r\nconst offset = dateTime.getTimeZoneOffset();\r\n```\r\n\r\n**Set Time Zone**\r\n\r\nSet the current 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```javascript\r\nconst newDateTime = dateTime.setTimeZone(timeZone);\r\n```\r\n\r\n**Set Time Zone Offset**\r\n\r\nSet the UTC offset (in minutes).\r\n\r\n- `offset` is the UTC offset (in minutes).\r\n\r\n```javascript\r\nconst newDateTime = dateTime.setTimeZoneOffset(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```javascript\r\nconst locale = dateTime.getLocale();\r\n```\r\n\r\n**Set Locale**\r\n\r\nSet the current locale.\r\n\r\n- `locale` is the name of the new locale.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.setLocale(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```javascript\r\nconst newDateTime = dateTime.addDay();\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```javascript\r\nconst newDateTime = dateTime.addDay(amount);\r\n```\r\n\r\n**Add Hour**\r\n\r\nAdd a hour to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.addHour();\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```javascript\r\nconst newDateTime = dateTime.addHours(amount);\r\n```\r\n\r\n**Add Minute**\r\n\r\nAdd a minute to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.addMinute();\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```javascript\r\nconst newDateTime = dateTime.addMinutes(amount);\r\n```\r\n\r\n**Add Month**\r\n\r\nAdd a month to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.addMonth();\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```javascript\r\nconst newDateTime = dateTime.addMonths(amount);\r\n```\r\n\r\n**Add Second**\r\n\r\nAdd a second to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.addSecond();\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```javascript\r\nconst newDateTime = dateTime.addSeconds(amount);\r\n```\r\n\r\n**Add Week**\r\n\r\nAdd a week to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.addWeek();\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```javascript\r\nconst newDateTime = dateTime.addWeeks(amount);\r\n```\r\n\r\n**Add Year**\r\n\r\nAdd a year to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.addYear();\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```javascript\r\nconst newDateTime = dateTime.addYears(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```javascript\r\nconst newDateTime = dateTime.endOfDay();\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```javascript\r\nconst newDateTime = dateTime.endOfHour();\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```javascript\r\nconst newDateTime = dateTime.endOfMinute();\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```javascript\r\nconst newDateTime = dateTime.endOfMonth();\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```javascript\r\nconst newDateTime = dateTime.endOfQuarter();\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```javascript\r\nconst newDateTime = dateTime.endOfSecond();\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```javascript\r\nconst newDateTime = dateTime.endOfWeek();\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```javascript\r\nconst newDateTime = dateTime.endOfYear();\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```javascript\r\nconst newDateTime = dateTime.startOfDay();\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```javascript\r\nconst newDateTime = dateTime.startOfHour();\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```javascript\r\nconst newDateTime = dateTime.startOfMinute();\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```javascript\r\nconst newDateTime = dateTime.startOfMonth();\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```javascript\r\nconst newDateTime = dateTime.startOfQuarter();\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```javascript\r\nconst newDateTime = dateTime.startOfSecond();\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```javascript\r\nconst newDateTime = dateTime.startOfWeek();\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```javascript\r\nconst newDateTime = dateTime.startOfYear();\r\n```\r\n\r\n**Subtract Day**\r\n\r\nSubtract a day to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.subtractDay();\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```javascript\r\nconst newDateTime = dateTime.subtractDay(amount);\r\n```\r\n\r\n**Subtract Hour**\r\n\r\nSubtract a hour to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.subtractHour();\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```javascript\r\nconst newDateTime = dateTime.subtractHours(amount);\r\n```\r\n\r\n**Subtract Minute**\r\n\r\nSubtract a minute to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.subtractMinute();\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```javascript\r\nconst newDateTime = dateTime.subtractMinutes(amount);\r\n```\r\n\r\n**Subtract Month**\r\n\r\nSubtract a month to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.subtractMonth();\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```javascript\r\nconst newDateTime = dateTime.subtractMonths(amount);\r\n```\r\n\r\n**Subtract Second**\r\n\r\nSubtract a second to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.subtractSecond();\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```javascript\r\nconst newDateTime = dateTime.subtractSeconds(amount);\r\n```\r\n\r\n**Subtract Week**\r\n\r\nSubtract a week to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.subtractWeek();\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```javascript\r\nconst newDateTime = dateTime.subtractWeeks(amount);\r\n```\r\n\r\n**Subtract Year**\r\n\r\nSubtract a year to the current date.\r\n\r\n```javascript\r\nconst newDateTime = dateTime.subtractYear();\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```javascript\r\nconst newDateTime = dateTime.subtractYears(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```javascript\r\nconst diff = dateTime.diff(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- `options` is an object containing options for how to compare the dates.\r\n    - `relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```javascript\r\nconst diff = dateTime.diffInDays(other, options);\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- `options` is an object containing options for how to compare the dates.\r\n    - `relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```javascript\r\nconst diff = dateTime.diffInHours(other, options);\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- `options` is an object containing options for how to compare the dates.\r\n    - `relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```javascript\r\nconst diff = dateTime.diffInMinutes(other, options);\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- `options` is an object containing options for how to compare the dates.\r\n    - `relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```javascript\r\nconst diff = dateTime.diffInMonths(other, options);\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- `options` is an object containing options for how to compare the dates.\r\n    - `relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```javascript\r\nconst diff = dateTime.diffInSeconds(other, options);\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- `options` is an object containing options for how to compare the dates.\r\n    - `relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```javascript\r\nconst diff = dateTime.diffInWeeks(other, options);\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- `options` is an object containing options for how to compare the dates.\r\n    - `relative` is a boolean indicating whether to return the relative difference, and will default to *true*.\r\n\r\n```javascript\r\nconst diff = dateTime.diffInYears(other, options);\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**Human Difference**\r\n\r\nGet the relative difference between two Dates in a human readable format using the current locale.\r\n\r\n- `other` is the *DateTime* object to compare to.\r\n\r\n```javascript\r\nconst humanDiff = dateTime.humanDiff(other);\r\n```\r\n\r\nThe most significant non-zero value is determined where the unit of time has a non-relative difference, or the next relative difference value is greater than or equal to the unit of time.\r\n\r\n```javascript\r\nDateTime.fromFormat('yyyy-MM-dd', '2019-01-01').humanDiff(DateTime.fromFormat('yyyy-MM-dd', '2018-12-31')); // \"tomorrow\"\r\nDateTime.fromFormat('yyyy-MM-dd', '2019-02-27').humanDiff(DateTime.fromFormat('yyyy-MM-dd', '2019-01-31')); // \"in 27 days\"\r\nDateTime.fromFormat('yyyy-MM-dd', '2019-02-28').humanDiff(DateTime.fromFormat('yyyy-MM-dd', '2019-01-31')); // \"next month\"\r\nDateTime.fromFormat('yyyy-MM-dd', '2019-01-01').humanDiff(DateTime.fromFormat('yyyy-MM-dd', '2018-06-01')); // \"in 6 months\"\r\nDateTime.fromFormat('yyyy-MM-dd', '2019-01-01').humanDiff(DateTime.fromFormat('yyyy-MM-dd', '2018-01-31')); // \"next year\"\r\nDateTime.fromFormat('yyyy-MM-dd', '2019-01-01').humanDiff(DateTime.fromFormat('yyyy-MM-dd', '2017-12-31')); // \"in 2 years\"\r\n```\r\n\r\n**Human Difference In Days**\r\n\r\nGet the relative difference between two Dates in days in a human readable format using the current locale.\r\n\r\n- `other` is the *DateTime* object to compare to.\r\n\r\n```javascript\r\nconst humanDiff = dateTime.humanDiffInDays(other);\r\n```\r\n\r\n**Human Difference In Hours**\r\n\r\nGet the relative difference between two Dates in hours in a human readable format using the current locale.\r\n\r\n- `other` is the *DateTime* object to compare to.\r\n\r\n```javascript\r\nconst humanDiff = dateTime.humanDiffInHours(other);\r\n```\r\n\r\n**Human Difference In Minutes**\r\n\r\nGet the relative difference between two Dates in minutes in a human readable format using the current locale.\r\n\r\n- `other` is the *DateTime* object to compare to.\r\n\r\n```javascript\r\nconst humanDiff = dateTime.humanDiffInMinutes(other);\r\n```\r\n\r\n**Human Difference In Months**\r\n\r\nGet the relative difference between two Dates in months in a human readable format using the current locale.\r\n\r\n- `other` is the *DateTime* object to compare to.\r\n\r\n```javascript\r\nconst humanDiff = dateTime.humanDiffInMonths(other);\r\n```\r\n\r\n**Human Difference In Seconds**\r\n\r\nGet the relative difference between two Dates in seconds in a human readable format using the current locale.\r\n\r\n- `other` is the *DateTime* object to compare to.\r\n\r\n```javascript\r\nconst humanDiff = dateTime.humanDiffInSeconds(other);\r\n```\r\n\r\n**Human Difference In Weeks**\r\n\r\nGet the relative difference between two Dates in weeks in a human readable format using the current locale.\r\n\r\n- `other` is the *DateTime* object to compare to.\r\n\r\n```javascript\r\nconst humanDiff = dateTime.humanDiffInWeeks(other);\r\n```\r\n\r\n**Human Difference In Years**\r\n\r\nGet the relative difference between two Dates in years in a human readable format using the current locale.\r\n\r\n- `other` is the *DateTime* object to compare to.\r\n\r\n```javascript\r\nconst humanDiff = dateTime.humanDiffInYears(other);\r\n```\r\n\r\n**Is After?**\r\n\r\nReturn *true* if the *DateTime* is after another date.\r\n\r\n- `other` is the *DateTime* object to compare to.\r\n\r\n```javascript\r\nconst isAfter = dateTime.isAfter(other);\r\n```\r\n\r\n**Is After Day?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isAfter = dateTime.isAfterDay(other);\r\n```\r\n\r\n**Is After Hour?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isAfter = dateTime.isAfterHour(other);\r\n```\r\n\r\n**Is After Minute?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isAfter = dateTime.isAfterMinute(other);\r\n```\r\n\r\n**Is After Month?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isAfter = dateTime.isAfterMonth(other);\r\n```\r\n\r\n**Is After Second?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isAfter = dateTime.isAfterSecond(other);\r\n```\r\n\r\n**Is After Week?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isAfter = dateTime.isAfterWeek(other);\r\n```\r\n\r\n**Is After Year?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isAfter = dateTime.isAfterYear(other);\r\n```\r\n\r\n**Is Before?**\r\n\r\nReturn *true* if the *DateTime* is before another date.\r\n\r\n- `other` is the *DateTime* object to compare to.\r\n\r\n```javascript\r\nconst isBefore = dateTime.isBefore(other);\r\n```\r\n\r\n**Is Before Day?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBefore = dateTime.isBeforeDay(other);\r\n```\r\n\r\n**Is Before Hour?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBefore = dateTime.isBeforeHour(other);\r\n```\r\n\r\n**Is Before Minute?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBefore = dateTime.isBeforeMinute(other);\r\n```\r\n\r\n**Is Before Month?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBefore = dateTime.isBeforeMonth(other);\r\n```\r\n\r\n**Is Before Second?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBefore = dateTime.isBeforeSecond(other);\r\n```\r\n\r\n**Is Before Week?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBefore = dateTime.isBeforeWeek(other);\r\n```\r\n\r\n**Is Before Year?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBefore = dateTime.isBeforeYear(other);\r\n```\r\n\r\n**Is Between?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBetween = dateTime.isBetween(start, end);\r\n```\r\n\r\n**Is Between Day?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBetween = dateTime.isBetweenDay(start, end);\r\n```\r\n\r\n**Is Between Hour?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBetween = dateTime.isBetweenHour(start, end);\r\n```\r\n\r\n**Is Between Minute?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBetween = dateTime.isBetweenMinute(start, end);\r\n```\r\n\r\n**Is Between Month?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBetween = dateTime.isBetweenMonth(start, end);\r\n```\r\n\r\n**Is Between Second?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBetween = dateTime.isBetweenSecond(start, end);\r\n```\r\n\r\n**Is Between Week?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBetween = dateTime.isBetweenWeek(start, end);\r\n```\r\n\r\n**Is Between Year?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isBetween = dateTime.isBetweenYear(start, end);\r\n```\r\n\r\n**Is Same?**\r\n\r\nReturn *true* if the *DateTime* is the same as another date.\r\n\r\n- `other` is the *DateTime* object to compare to.\r\n\r\n```javascript\r\nconst isSame = dateTime.isSame(other);\r\n```\r\n\r\n**Is Same Day?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSame = dateTime.isSameDay(other);\r\n```\r\n\r\n**Is Same Hour?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSame = dateTime.isSameHour(other);\r\n```\r\n\r\n**Is Same Minute?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSame = dateTime.isSameMinute(other);\r\n```\r\n\r\n**Is Same Month?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSame = dateTime.isSameMonth(other);\r\n```\r\n\r\n**Is Same Second?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSame = dateTime.isSameSecond(other);\r\n```\r\n\r\n**Is Same Week?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSame = dateTime.isSameWeek(other);\r\n```\r\n\r\n**Is Same Year?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSame = dateTime.isSameYear(other);\r\n```\r\n\r\n**Is Same Or After?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrAfter = dateTime.isSameOrAfter(other);\r\n```\r\n\r\n**Is Same Or After Day?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrAfter = dateTime.isSameOrAfterDay(other);\r\n```\r\n\r\n**Is Same Or After Hour?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrAfter = dateTime.isSameOrAfterHour(other);\r\n```\r\n\r\n**Is Same Or After Minute?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrAfter = dateTime.isSameOrAfterMinute(other);\r\n```\r\n\r\n**Is Same Or After Month?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrAfter = dateTime.isSameOrAfterMonth(other);\r\n```\r\n\r\n**Is Same Or After Second?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrAfter = dateTime.isSameOrAfterSecond(other);\r\n```\r\n\r\n**Is Same Or After Week?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrAfter = dateTime.isSameOrAfterWeek(other);\r\n```\r\n\r\n**Is Same Or After Year?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrAfter = dateTime.isSameOrAfterYear(other);\r\n```\r\n\r\n**Is Same Or Before?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrBefore = dateTime.isSameOrBefore(other);\r\n```\r\n\r\n**Is Same Or Before Day?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrBefore = dateTime.isSameOrBeforeDay(other);\r\n```\r\n\r\n**Is Same Or Before Hour?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrBefore = dateTime.isSameOrBeforeHour(other);\r\n```\r\n\r\n**Is Same Or Before Minute?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrBefore = dateTime.isSameOrBeforeMinute(other);\r\n```\r\n\r\n**Is Same Or Before Month?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrBefore = dateTime.isSameOrBeforeMonth(other);\r\n```\r\n\r\n**Is Same Or Before Second?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrBefore = dateTime.isSameOrBeforeSecond(other);\r\n```\r\n\r\n**Is Same Or Before Week?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrBefore = dateTime.isSameOrBeforeWeek(other);\r\n```\r\n\r\n**Is Same Or Before Year?**\r\n\r\nReturn *true* if 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```javascript\r\nconst isSameOrBefore = dateTime.isSameOrBeforeYear(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```javascript\r\nconst dayName = dateTime.dayName(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```javascript\r\nconst dayPeriod = dateTime.dayPeriod(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```javascript\r\nconst daysInMonth = dateTime.daysInMonth();\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```javascript\r\nconst daysInYear = dateTime.daysInYear();\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```javascript\r\nconst era = dateTime.era(type);\r\n```\r\n\r\n**Is DST?**\r\n\r\nReturn *true* if the *DateTime* is in daylight savings.\r\n\r\n```javascript\r\nconst isDST = dateTime.isDST();\r\n```\r\n\r\n**Is Leap Year?**\r\n\r\nReturn *true* if the year is a leap year.\r\n\r\n```javascript\r\nconst isLeapYear = dateTime.isLeapYear();\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```javascript\r\nconst monthName = dateTime.monthName(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```javascript\r\nconst timeZoneName = dateTime.timeZoneName(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```javascript\r\nconst weeksInYear = dateTime.weeksInYear();\r\n```\r\n\r\n\r\n## Static Methods\r\n\r\n**Day Of Year**\r\n\r\nGet the day of the year for a year, month and date.\r\n\r\n- `year` is a number representing the year.\r\n- `month` is a number representing the month (between *1* and *12*).\r\n- `date` is a number representing the date.\r\n\r\n```javascript\r\nconst dayOfYear = DateTime.dayOfYear(year, month, date);\r\n```\r\n\r\n**Days In Month**\r\n\r\nGet the number of days in a month, from a year and month.\r\n\r\n- `year` is a number representing the year.\r\n- `month` is a number representing the month (between *1* and *12*).\r\n\r\n```javascript\r\nconst daysInMonth = DateTime.daysInMonth(year, month);\r\n```\r\n\r\n**Days In Year**\r\n\r\nGet the number of days in a year.\r\n\r\n- `year` is a number representing the year.\r\n\r\n```javascript\r\nconst daysInYear = DateTime.daysInYear(year);\r\n```\r\n\r\n**Get Default Locale**\r\n\r\nGet the default locale.\r\n\r\n```javascript\r\nconst 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```javascript\r\nconst timeZone = DateTime.getDefaultTimeZone();\r\n```\r\n\r\n**Is Leap Year?**\r\n\r\nReturn *true* if the year is a leap year.\r\n\r\n- `year` is a number representing the year.\r\n\r\n```javascript\r\nconst isLeapYear = DateTime.isLeapYear(year);\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```javascript\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 name of the locale.\r\n\r\n```javascript\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 name of the 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```javascript\r\nDateTime.setDefaultTimeZone(timeZone);\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffrostdatetime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felusivecodes%2Ffrostdatetime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffrostdatetime/lists"}