Requires: a Date; a whole Numeric amount or a Duration; and optional weekend Text. Fractional days in a Duration are discarded toward zero. Negative amounts move backward.
Returns: Date.
Best for: business deadlines and service schedules.
The default weekend is Saturday and Sunday. Custom weekend text can contain one or two weekday digits (1 Monday through 7 Sunday), or a seven-character Monday-to-Sunday mask where 1 marks a weekend day.
Counts year boundaries crossed from one date to another.
Syntax:YearsBetween(startDate, endDate)
Requires: two Dates.
Returns: signed Numeric boundary count.
Best for: calendar-year buckets rather than exact anniversaries.
YearsBetween([Start Date], [End Date])
Month and day do not affect this boundary count.
Use AdjustMonth and AdjustYear for calendar movement. Use Days and Duration arithmetic when you mean a fixed elapsed amount.
Last modified on September 7, 2026
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"FarmTrace documentation","description":"Public guidance for FarmTrace Dsync, Device Kit, and the formula language.","colors":{"primary":"#1B6F45","light":"#4ADE80","dark":"#278A56"},"logo":{"light":"https://mintcdn.com/farmtrace/dU8dLDBOMj0npTRB/logo/light.svg?fit=max\u0026auto=format\u0026n=dU8dLDBOMj0npTRB\u0026q=85\u0026s=a32d62b068cf7f7610b6dbdfe9819f6a","dark":"https://mintcdn.com/farmtrace/dU8dLDBOMj0npTRB/logo/dark.svg?fit=max\u0026auto=format\u0026n=dU8dLDBOMj0npTRB\u0026q=85\u0026s=f209a8925c59e1d88e8f71da098175b7","href":"https://farmtrace.co.za"},"favicon":"https://mintcdn.com/farmtrace/dU8dLDBOMj0npTRB/favicon.png?fit=max\u0026auto=format\u0026n=dU8dLDBOMj0npTRB\u0026q=85\u0026s=cdb3c190e3d23b4128d11251a1cac33b","appearance":{"default":"system"},"background":{"decoration":"gradient","color":{"light":"#F3F4F1","dark":"#0B1F12"}},"navbar":{"links":[{"href":"https://farmtrace.co.za","label":"FarmTrace website"},{"href":"mailto:support@farmtrace.co.za","label":"Support"}],"primary":{"type":"button","label":"Visit FarmTrace","href":"https://farmtrace.co.za"}},"seo":{"indexing":"all"},"fonts":{"family":"Geist"},"icons":{"library":"lucide"},"styling":{"eyebrows":"section","codeblocks":{"theme":{"light":"github-light","dark":"github-dark"}},"latex":true},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"metadata":{"timestamp":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"farmtrace","hasAudioNarration":false,"actualSubdomain":"farmtrace","customDomains":["docs.farmtrace.co.za"],"gitSource":{"type":"github","owner":"farmtracedev","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6a9ecfb050567d98f662842a","collectionId":"820c3df3-54bd-4eda-b24a-9dc94f6432f1","liveDeploymentHistoryId":"6a9ecfb050567d98f662842a","schemaVersion":"v3"},"entitlements":{},"buildId":"6a9ecfb050567d98f662842a","clientVersion":"0.0.4067","searchFilterCounts":[{"language":"default","tag":"Dsync","count":34},{"language":"default","tag":"Formula reference","count":16},{"language":"default","tag":"Configuration","count":8},{"language":"default","tag":"Device Kit","count":5},{"language":"default","tag":"Device Kit guides","count":5},{"language":"default","tag":"Function setup","count":4},{"language":"default","tag":"Dsync guides","count":3},{"language":"default","tag":"Formula language","count":3},{"language":"default","tag":"Start here","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"reference/date","slug":"/reference/date","pageMetadata":{"title":"Date functions","description":"Create dates and calculate calendar parts, periods, weeks, quarters, years, and workdays.","href":"/reference/date"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Create dates and calculate calendar parts, periods, weeks, quarters, years, and workdays.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`A Date contains a calendar day without a time of day. Date literals use `,_jsx(_components.code,{children:`#yyyy-MM-dd#`}),`, for example `,_jsx(_components.code,{children:`#2026-08-31#`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`adjustmonth`,children:_jsx(_components.code,{children:`AdjustMonth`})}),`\n`,_jsx(_components.p,{children:`Moves a date by a whole number of calendar months.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`AdjustMonth(date, months)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date and a whole Numeric month count. Negative counts move backward.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` monthly renewals, due dates, and reporting cycles.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`AdjustMonth([Start Date], 3)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`When the target month is shorter, the day is clamped to that month’s last valid day.`}),`\n`,_jsx(Heading,{level:`2`,id:`adjustyear`,children:_jsx(_components.code,{children:`AdjustYear`})}),`\n`,_jsx(_components.p,{children:`Moves a date by a whole number of calendar years.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`AdjustYear(date, years)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date and a whole Numeric year count. Negative counts move backward.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` anniversaries, annual renewals, and age windows.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`AdjustYear([Certification Date], 1)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Moving February 29 into a non-leap year uses the last valid day of February.`}),`\n`,_jsx(Heading,{level:`2`,id:`date`,children:_jsx(_components.code,{children:`Date`})}),`\n`,_jsx(_components.p,{children:`Creates a calendar date from numeric components.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`Date(year, month, day)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` three whole Numeric values that form a valid date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` fixed dates and dates assembled from separate imported fields.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Date(2026, 8, 31)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`day`,children:_jsx(_components.code,{children:`Day`})}),`\n`,_jsx(_components.p,{children:`Returns the day of the month.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`Day(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Numeric from `,_jsx(_components.code,{children:`1`}),` through `,_jsx(_components.code,{children:`31`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` monthly grouping and calendar labels.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Day([Inspection Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`dayofweek`,children:_jsx(_components.code,{children:`DayOfWeek`})}),`\n`,_jsx(_components.p,{children:`Returns the weekday number, starting with Sunday.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`DayOfWeek(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Numeric: Sunday is `,_jsx(_components.code,{children:`0`}),`, Monday `,_jsx(_components.code,{children:`1`}),`, through Saturday `,_jsx(_components.code,{children:`6`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` weekday rules and weekend checks.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`In(DayOfWeek([Inspection Date]), 0, 6)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`dayofyear`,children:_jsx(_components.code,{children:`DayOfYear`})}),`\n`,_jsx(_components.p,{children:`Returns how many days a date follows January 1.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`DayOfYear(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` zero-based Numeric: January 1 is `,_jsx(_components.code,{children:`0`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` seasonal grouping and day-of-year comparisons.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`DayOfYear([Harvest Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`firstdayofmonth`,children:_jsx(_components.code,{children:`FirstDayOfMonth`})}),`\n`,_jsx(_components.p,{children:`Returns the first date in the same month.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`FirstDayOfMonth(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` monthly report windows and grouping.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`FirstDayOfMonth([Invoice Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`firstdayofperiod`,children:_jsx(_components.code,{children:`FirstDayOfPeriod`})}),`\n`,_jsx(_components.p,{children:`Finds the first day of a repeating fixed-length period anchored to a reference date.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`FirstDayOfPeriod(date, duration, referenceDate)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` two Dates and a positive Duration. Fractional days are discarded toward zero, so the Duration must contain at least one full day.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` custom 7-day, 14-day, or other fixed reporting cycles.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`FirstDayOfPeriod([Inspection Date], Days(14), #2026-01-05#)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`firstdayofquarter`,children:_jsx(_components.code,{children:`FirstDayOfQuarter`})}),`\n`,_jsx(_components.p,{children:`Returns the first date in the same calendar quarter.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`FirstDayOfQuarter(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` quarterly reports and targets.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`FirstDayOfQuarter([Invoice Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`firstdayofweek`,children:_jsx(_components.code,{children:`FirstDayOfWeek`})}),`\n`,_jsx(_components.p,{children:`Returns the Sunday at the start of the date’s week.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`FirstDayOfWeek(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` Sunday-to-Saturday reporting windows.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`FirstDayOfWeek([Inspection Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`firstdayofyear`,children:_jsx(_components.code,{children:`FirstDayOfYear`})}),`\n`,_jsx(_components.p,{children:`Returns January 1 in the same year.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`FirstDayOfYear(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` year-to-date reporting.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`FirstDayOfYear([Invoice Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`isoweek`,children:_jsx(_components.code,{children:`ISOWeek`})}),`\n`,_jsx(_components.p,{children:`Returns the ISO 8601 week number.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`ISOWeek(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Numeric week number using Monday as the first weekday and the ISO first-week rule.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` internationally consistent weekly reporting.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`ISOWeek([Inspection Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`isleapday`,children:_jsx(_components.code,{children:`IsLeapDay`})}),`\n`,_jsx(_components.p,{children:`Checks whether a date is February 29.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`IsLeapDay(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Boolean.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` anniversary and renewal edge cases.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`IsLeapDay([Start Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`isleapyear`,children:_jsx(_components.code,{children:`IsLeapYear`})}),`\n`,_jsx(_components.p,{children:`Checks whether a date’s year, or a supplied year number, is a leap year.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`IsLeapYear(dateOrYear)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date or whole Numeric year.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Boolean.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` February and annual-calendar rules.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`IsLeapYear([Inspection Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`IsLeapYear(2028)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`lastdayofmonth`,children:_jsx(_components.code,{children:`LastDayOfMonth`})}),`\n`,_jsx(_components.p,{children:`Returns the last date in the same month.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`LastDayOfMonth(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` monthly deadlines and report ranges.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`LastDayOfMonth([Invoice Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`lastdayofperiod`,children:_jsx(_components.code,{children:`LastDayOfPeriod`})}),`\n`,_jsx(_components.p,{children:`Finds the last day of a repeating fixed-length period anchored to a reference date.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`LastDayOfPeriod(date, duration, referenceDate)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` two Dates and a positive Duration. Fractional days are discarded toward zero, so the Duration must contain at least one full day.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` the closing date of custom reporting cycles.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`LastDayOfPeriod([Inspection Date], Days(14), #2026-01-05#)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`lastdayofquarter`,children:_jsx(_components.code,{children:`LastDayOfQuarter`})}),`\n`,_jsx(_components.p,{children:`Returns the last date in the same calendar quarter.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`LastDayOfQuarter(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` quarterly deadlines and report ranges.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`LastDayOfQuarter([Invoice Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`lastdayofweek`,children:_jsx(_components.code,{children:`LastDayOfWeek`})}),`\n`,_jsx(_components.p,{children:`Returns the Saturday at the end of the date’s week.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`LastDayOfWeek(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` Sunday-to-Saturday reporting windows.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`LastDayOfWeek([Inspection Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`lastdayofyear`,children:_jsx(_components.code,{children:`LastDayOfYear`})}),`\n`,_jsx(_components.p,{children:`Returns December 31 in the same year.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`LastDayOfYear(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` annual report and validity windows.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`LastDayOfYear([Invoice Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`month`,children:_jsx(_components.code,{children:`Month`})}),`\n`,_jsx(_components.p,{children:`Returns the calendar month number.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`Month(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Numeric from `,_jsx(_components.code,{children:`1`}),` for January through `,_jsx(_components.code,{children:`12`}),` for December.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` monthly grouping and conditional rules.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Month([Harvest Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`monthsbetween`,children:_jsx(_components.code,{children:`MonthsBetween`})}),`\n`,_jsx(_components.p,{children:`Counts month boundaries crossed from one date to another.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`MonthsBetween(startDate, endDate)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` two Dates.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` signed Numeric boundary count.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` calendar-month reporting buckets rather than exact elapsed time.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`MonthsBetween([Start Date], [End Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Day numbers do not affect the result; January 31 to February 1 crosses one month boundary.`}),`\n`,_jsx(Heading,{level:`2`,id:`nextdayofweek`,children:_jsx(_components.code,{children:`NextDayOfWeek`})}),`\n`,_jsx(_components.p,{children:`Returns the next requested weekday strictly after a date.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`NextDayOfWeek(date, weekday)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date and a whole Numeric weekday from `,_jsx(_components.code,{children:`0`}),` (Sunday) through `,_jsx(_components.code,{children:`6`}),` (Saturday).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` next collection, meeting, or processing day rules.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`NextDayOfWeek([Order Date], 1)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`If the supplied date is already that weekday, the result is seven days later.`}),`\n`,_jsx(Heading,{level:`2`,id:`prevdayofweek`,children:_jsx(_components.code,{children:`PrevDayOfWeek`})}),`\n`,_jsx(_components.p,{children:`Returns the requested weekday strictly before a date.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`PrevDayOfWeek(date, weekday)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date and a whole Numeric weekday from `,_jsx(_components.code,{children:`0`}),` (Sunday) through `,_jsx(_components.code,{children:`6`}),` (Saturday).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` previous cut-off or reporting-day rules.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PrevDayOfWeek([Order Date], 5)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`If the supplied date is already that weekday, the result is seven days earlier.`}),`\n`,_jsx(Heading,{level:`2`,id:`quarter`,children:_jsx(_components.code,{children:`Quarter`})}),`\n`,_jsx(_components.p,{children:`Returns the calendar quarter number.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`Quarter(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Numeric from `,_jsx(_components.code,{children:`1`}),` through `,_jsx(_components.code,{children:`4`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` quarterly grouping and targets.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Quarter([Invoice Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`quartersbetween`,children:_jsx(_components.code,{children:`QuartersBetween`})}),`\n`,_jsx(_components.p,{children:`Counts quarter boundaries crossed from one date to another.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`QuartersBetween(startDate, endDate)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` two Dates.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` signed Numeric boundary count.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` calendar-quarter reporting buckets.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`QuartersBetween([Start Date], [End Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`today`,children:_jsx(_components.code,{children:`Today`})}),`\n`,_jsx(_components.p,{children:`Returns the current date in the active formula timezone.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`Today()`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` the evaluation clock and timezone supplied by Dsync.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` due, overdue, age, and validity checks.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`[Due Date] \u003c Today()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Every `,_jsx(_components.code,{children:`Today()`}),` call in one evaluation observes the same date.`]}),`\n`,_jsx(Heading,{level:`2`,id:`week`,children:_jsx(_components.code,{children:`Week`})}),`\n`,_jsx(_components.p,{children:`Returns the week number using a locale-based or explicitly selected first weekday.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`Week(date[, firstWeekday])`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date and optional whole Numeric weekday from `,_jsx(_components.code,{children:`0`}),` (Sunday) through `,_jsx(_components.code,{children:`6`}),` (Saturday). Without it, the active locale chooses the first weekday.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Numeric week number.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` locally configured weekly reports.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Week([Inspection Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Week([Inspection Date], 1)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`ISOWeek`}),` when reports must follow ISO 8601 everywhere.`]}),`\n`,_jsx(Heading,{level:`2`,id:`workday`,children:_jsx(_components.code,{children:`Workday`})}),`\n`,_jsx(_components.p,{children:`Moves a date by a number of working days.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`Workday(date, amount[, weekend])`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date; a whole Numeric amount or a Duration; and optional weekend Text. Fractional days in a Duration are discarded toward zero. Negative amounts move backward.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` business deadlines and service schedules.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Workday([Submitted Date], 5)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Workday([Submitted Date], 5, \"67\")`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`The default weekend is Saturday and Sunday. Custom weekend text can contain one or two weekday digits (`,_jsx(_components.code,{children:`1`}),` Monday through `,_jsx(_components.code,{children:`7`}),` Sunday), or a seven-character Monday-to-Sunday mask where `,_jsx(_components.code,{children:`1`}),` marks a weekend day.`]}),`\n`,_jsx(Heading,{level:`2`,id:`workdays`,children:_jsx(_components.code,{children:`Workdays`})}),`\n`,_jsx(_components.p,{children:`Counts working days between two dates, including both endpoints.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`Workdays(startDate, endDate[, weekend])`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` two Dates and optional weekend Text in the same format as `,_jsx(_components.code,{children:`Workday`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Duration containing the signed number of working days.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` turnaround time and service-level reporting.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`ToDays(Workdays([Opened Date], [Closed Date]))`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`The result is negative when the end date is before the start date.`}),`\n`,_jsx(Heading,{level:`2`,id:`year`,children:_jsx(_components.code,{children:`Year`})}),`\n`,_jsx(_components.p,{children:`Returns the calendar year.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`Year(date)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` a Date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` Numeric year.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` annual grouping and labels.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Year([Harvest Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`yearsbetween`,children:_jsx(_components.code,{children:`YearsBetween`})}),`\n`,_jsx(_components.p,{children:`Counts year boundaries crossed from one date to another.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Syntax:`}),` `,_jsx(_components.code,{children:`YearsBetween(startDate, endDate)`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Requires:`}),` two Dates.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Returns:`}),` signed Numeric boundary count.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Best for:`}),` calendar-year buckets rather than exact anniversaries.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`YearsBetween([Start Date], [End Date])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Month and day do not affect this boundary count.`}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`AdjustMonth`}),` and `,_jsx(_components.code,{children:`AdjustYear`}),` for calendar movement. Use `,_jsx(_components.code,{children:`Days`}),` and Duration arithmetic when you mean a fixed elapsed amount.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light","dark":"github-dark"}},"config":{},"pageMetadata":{"title":"Date functions","description":"Create dates and calculate calendar parts, periods, weeks, quarters, years, and workdays.","href":"/reference/date"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"AdjustMonth","slug":"adjustmonth","depth":2,"children":[]},{"title":"AdjustYear","slug":"adjustyear","depth":2,"children":[]},{"title":"Date","slug":"date","depth":2,"children":[]},{"title":"Day","slug":"day","depth":2,"children":[]},{"title":"DayOfWeek","slug":"dayofweek","depth":2,"children":[]},{"title":"DayOfYear","slug":"dayofyear","depth":2,"children":[]},{"title":"FirstDayOfMonth","slug":"firstdayofmonth","depth":2,"children":[]},{"title":"FirstDayOfPeriod","slug":"firstdayofperiod","depth":2,"children":[]},{"title":"FirstDayOfQuarter","slug":"firstdayofquarter","depth":2,"children":[]},{"title":"FirstDayOfWeek","slug":"firstdayofweek","depth":2,"children":[]},{"title":"FirstDayOfYear","slug":"firstdayofyear","depth":2,"children":[]},{"title":"ISOWeek","slug":"isoweek","depth":2,"children":[]},{"title":"IsLeapDay","slug":"isleapday","depth":2,"children":[]},{"title":"IsLeapYear","slug":"isleapyear","depth":2,"children":[]},{"title":"LastDayOfMonth","slug":"lastdayofmonth","depth":2,"children":[]},{"title":"LastDayOfPeriod","slug":"lastdayofperiod","depth":2,"children":[]},{"title":"LastDayOfQuarter","slug":"lastdayofquarter","depth":2,"children":[]},{"title":"LastDayOfWeek","slug":"lastdayofweek","depth":2,"children":[]},{"title":"LastDayOfYear","slug":"lastdayofyear","depth":2,"children":[]},{"title":"Month","slug":"month","depth":2,"children":[]},{"title":"MonthsBetween","slug":"monthsbetween","depth":2,"children":[]},{"title":"NextDayOfWeek","slug":"nextdayofweek","depth":2,"children":[]},{"title":"PrevDayOfWeek","slug":"prevdayofweek","depth":2,"children":[]},{"title":"Quarter","slug":"quarter","depth":2,"children":[]},{"title":"QuartersBetween","slug":"quartersbetween","depth":2,"children":[]},{"title":"Today","slug":"today","depth":2,"children":[]},{"title":"Week","slug":"week","depth":2,"children":[]},{"title":"Workday","slug":"workday","depth":2,"children":[]},{"title":"Workdays","slug":"workdays","depth":2,"children":[]},{"title":"Year","slug":"year","depth":2,"children":[]},{"title":"YearsBetween","slug":"yearsbetween","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"farmtrace","siteName":"FarmTrace documentation","title":"Date functions - FarmTrace documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-07T13:14:21.502Z","gitLastModified":"2026-09-07T12:27:48.000Z","originalFileLocation":"reference/date.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create dates and calculate calendar parts, periods, weeks, quarters, years, and workdays.\">\u003cmeta data-mint-head name=\"application-name\" content=\"FarmTrace documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/farmtrace/Ko51b9WVXdxCGCIX/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/farmtrace/Ko51b9WVXdxCGCIX/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/farmtrace/Ko51b9WVXdxCGCIX/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/farmtrace/Ko51b9WVXdxCGCIX/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/farmtrace/Ko51b9WVXdxCGCIX/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/farmtrace/Ko51b9WVXdxCGCIX/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/farmtrace/Ko51b9WVXdxCGCIX/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/farmtrace/Ko51b9WVXdxCGCIX/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/farmtrace/Ko51b9WVXdxCGCIX/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Date functions - FarmTrace documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create dates and calculate calendar parts, periods, weeks, quarters, years, and workdays.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"FarmTrace documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.farmtrace.co.za/reference/date\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://farmtrace.mintlify.app/_mintlify/api/og/v2?division=Formula+reference\u0026amp;title=Date+functions\u0026amp;description=Create+dates+and+calculate+calendar+parts%2C+periods%2C+weeks%2C+quarters%2C+years%2C+and+workdays.\u0026amp;theme=09ecce6343d2410fee452256\u0026amp;signature=67c0b29939c26eed93a24840af348497cdd9243c746c315e5dd9256184b782a9\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Date functions - FarmTrace documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create dates and calculate calendar parts, periods, weeks, quarters, years, and workdays.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://farmtrace.mintlify.app/_mintlify/api/og/v2?division=Formula+reference\u0026amp;title=Date+functions\u0026amp;description=Create+dates+and+calculate+calendar+parts%2C+periods%2C+weeks%2C+quarters%2C+years%2C+and+workdays.\u0026amp;theme=09ecce6343d2410fee452256\u0026amp;signature=67c0b29939c26eed93a24840af348497cdd9243c746c315e5dd9256184b782a9\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/farmtrace/Ko51b9WVXdxCGCIX/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"FarmTrace documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1B6F45\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.farmtrace.co.za/reference/date\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/reference/date.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.farmtrace.co.za/#organization\",\"name\":\"FarmTrace documentation\",\"url\":\"https://docs.farmtrace.co.za\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/farmtrace/dU8dLDBOMj0npTRB/logo/light.svg?fit=max\u0026auto=format\u0026n=dU8dLDBOMj0npTRB\u0026q=85\u0026s=a32d62b068cf7f7610b6dbdfe9819f6a\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.farmtrace.co.za#website\",\"name\":\"FarmTrace documentation\",\"url\":\"https://docs.farmtrace.co.za\",\"publisher\":{\"@id\":\"https://docs.farmtrace.co.za/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.farmtrace.co.za/reference/date#webpage\",\"url\":\"https://docs.farmtrace.co.za/reference/date\",\"name\":\"Date functions\",\"description\":\"Create dates and calculate calendar parts, periods, weeks, quarters, years, and workdays.\",\"dateModified\":\"2026-09-07T12:27:48.000Z\",\"isPartOf\":{\"@id\":\"https://docs.farmtrace.co.za#website\"},\"breadcrumb\":{\"@id\":\"https://docs.farmtrace.co.za/reference/date#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.farmtrace.co.za/reference/date#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Formula reference\",\"item\":\"https://docs.farmtrace.co.za/reference/index\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Date functions\",\"item\":\"https://docs.farmtrace.co.za/reference/date\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.farmtrace.co.za/reference/date#article\",\"headline\":\"Date functions\",\"name\":\"Date functions\",\"description\":\"Create dates and calculate calendar parts, periods, weeks, quarters, years, and workdays.\",\"url\":\"https://docs.farmtrace.co.za/reference/date\",\"mainEntityOfPage\":{\"@id\":\"https://docs.farmtrace.co.za/reference/date#webpage\"},\"dateModified\":\"2026-09-07T12:27:48.000Z\",\"publisher\":{\"@id\":\"https://docs.farmtrace.co.za/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.farmtrace.co.za#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"FarmTrace documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"FarmTrace documentation","nav":{"global":null,"tabs":[{"tab":"Start here","icon":"compass","pages":[{"title":"Start here","href":""}]},{"tab":"Dsync","icon":"sprout","groups":[{"group":"Dsync guides","icon":"book-open","pages":[{"title":"Dsync","href":"/dsync"},{"title":"Field operations","href":"/dsync/field-operations"},{"title":"Sync and connectivity","href":"/dsync/sync-and-connectivity"}]},{"group":"Function setup","icon":"braces","pages":[{"title":"Function setup","href":"/dsync/function-setup"},{"title":"Form fields","href":"/dsync/function-setup/form-fields"},{"title":"Component types","href":"/dsync/function-setup/component-types"},{"title":"Component fields","href":"/dsync/function-setup/component-fields"}]},{"group":"Configuration","icon":"sliders-horizontal","pages":[{"title":"Table Setup Guide","href":"/dsync/table-setup"},{"title":"Table setup fields","href":"/dsync/table-setup/table-fields"},{"title":"Filters and role access","href":"/dsync/table-setup/filters-and-roles"},{"title":"Table screen fields","href":"/dsync/table-setup/screen-fields"},{"title":"Table screens","href":"/dsync/table-setup/table-screen"},{"title":"Reference data and scanning","href":"/dsync/table-setup/reference-data"},{"title":"Configuration patterns","href":"/dsync/table-setup/configuration-patterns"},{"title":"Troubleshooting and limitations","href":"/dsync/table-setup/troubleshooting"}]},{"group":"Formula language","icon":"braces","pages":[{"title":"Write your first formula","href":"/getting-started/write-your-first-formula"},{"title":"Values and references","href":"/getting-started/values-and-references"},{"title":"Formula Contexts","href":"/getting-started/formula-contexts"}]},{"group":"Formula reference","icon":"book-open","pages":[{"title":"Formula index","href":"/reference/index"},{"title":"Conversion functions","href":"/reference/conversion"},{"title":"Text functions","description":"Join, inspect, split, clean, pad, and URL-encode client-facing text.","href":"/reference/text"},{"title":"Date functions","href":"/reference/date"},{"title":"Time functions","description":"Create a time of day and read its hour, minute, or second.","href":"/reference/time"},{"title":"Timestamp functions","href":"/reference/timestamp"},{"title":"Numeric functions","href":"/reference/numeric"},{"title":"Rounding functions","href":"/reference/rounding"},{"title":"Aggregation functions","href":"/reference/aggregation"},{"title":"Null handling functions","href":"/reference/nulls"},{"title":"Duration functions","href":"/reference/duration"},{"title":"Location functions","href":"/reference/location"},{"title":"Special functions","href":"/reference/special"},{"title":"Session functions","href":"/reference/session"},{"title":"Ask and Parameter","href":"/reference/ask"},{"title":"Operators","href":"/reference/operators"}]}]},{"tab":"Device Kit","icon":"microchip","pages":[{"title":"Device Kit","href":"/device-kit"}]}]},"basePath":"","title":"Date functions - FarmTrace documentation","buildId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","deploymentId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","dynamics":[],"chunks":[]}