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
"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.
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Dynamics 365 Business Central: How to add a “TAB” character to a string via AL — possibly related: both name Codeunit 10 “Type Helper”
- Dynamics 365 Business Central: How to add Filter by item attributes to the Item Ledger Entries page — possibly related: both name Codeunit 10 “Type Helper”
- Dynamics 365 Business Central: How to add Notes (System Parts) from FactBox to a report — possibly related: both name Codeunit 10 “Type Helper”
- Dynamics 365 Business Central: How to add or subtract hours from a DateTime field — possibly related: both name Codeunit 10 “Type Helper”
- Understanding AL Development: The Type Helper Code Unit — possibly related: both name Codeunit 10 “Type Helper”
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.