community postAL Developmentcommunity - not Microsoftreviewed - checked by Opus

Dynamics 365 Business Central: How to convert Month Name (Text) to Month Number (Integer)

Converting a month name text value to its corresponding month number integer is possible using the GetLocalizedMonthToInt method from the standard Type Helper codeunit. This functionality is useful when you need to transform text representations of months like 'January' into numeric values like 1.

post Dynamics 365 Lab

Yun Zhu · 2026-02-10 · 162 words · about 1 min

"a standard method already exists for this. codeunit 10 "Type Helper" -> procedure GetLocalizedMonthToInt"

Key points

  • Type Helper codeunit provides the built-in GetLocalizedMonthToInt procedure for this conversion
  • The method accepts a text parameter containing the month name and returns an integer
  • This is a simple, standard approach that requires minimal code implementation
  • Useful for scenarios requiring numeric month values from textual inputs

Quotes

  • “a standard method already exists for this. codeunit 10 “Type Helper” -> procedure GetLocalizedMonthToInt” (It identifies the exact built-in method and location for solving the month conversion problem without custom development.)

AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

No source states these links: they share an object, a model read them, or a person found the same subject.

Context

  • Features: GetLocalizedMonthToInt method, month name to number conversion, localized month handling

Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.