---
id: post/yzhums-com/17631
type: post
title: "Dynamics 365 Business Central: How to convert Text/Integer to Date (Text/Integer Data type -> Date Data type)"
summary: This guide demonstrates how to convert Text and Integer data types to Date in Business Central AL development. It covers using the Evaluate method with regional settings, the DMY2Date function with string slicing for fixed formats, and techniques for parsing serialized integers in YYYYMMDD format.
tier: community
language: en
tags:
  - data type conversion
  - text parsing
  - date handling
  - al methods
  - api responses
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-26T06:40:58.246Z"
  flags: []
generated:
  at: "2026-10-26T05:51:10.938Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: cc82e7a665fe419c9a83d6eb1929b5625fa57048880371abccb98e2421441fa7
evidence:
  - kind: blog
    url: https://yzhums.com/17631/
    title: "Dynamics 365 Business Central: How to convert Text/Integer to Date (Text/Integer Data type -> Date Data type)"
    date: "2026-02-24"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://yzhums.com/17631/
    title: "Dynamics 365 Business Central: How to convert Text/Integer to Date (Text/Integer Data type -> Date Data type)"
    date: "2026-02-24"
    commit: null
    t: null
    quote: It uses the user's regional settings to parse the string. Always wrap it in an if statement to handle formatting errors gracefully.
  - kind: blog
    url: https://yzhums.com/17631/
    title: "Dynamics 365 Business Central: How to convert Text/Integer to Date (Text/Integer Data type -> Date Data type)"
    date: "2026-02-24"
    commit: null
    t: null
    quote: If you receive a fixed format (like YYYYMMDD) that doesn't match the user's locale, use CopyStr to break it down
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "17631"
source_id: yzhums-com
source_name: Dynamics 365 Lab - Yun Zhu
url: https://yzhums.com/17631/
published_at: "2026-02-24T01:21:53.000Z"
author: Yun Zhu
full_text: false
words: 708
quotes:
  - text: It uses the user's regional settings to parse the string. Always wrap it in an if statement to handle formatting errors gracefully.
    why_it_matters: Essential practice for robust data conversion that respects user localization and prevents runtime errors
  - text: If you receive a fixed format (like YYYYMMDD) that doesn't match the user's locale, use CopyStr to break it down
    why_it_matters: Provides reliable handling of standardized date formats that differ from user regional settings
code_objects_mentioned:
  - other SalesOrderExt
systems:
  - development
versions_mentioned: []
preview:
  embeddable: true
  frame_url: null
  image: https://yzhums.com/wp-content/uploads/2026/02/Snipaste_2026-02-24_10-18-24.png
  image_alt: null
  image_w: null
  image_h: null
  site_name: Dynamics 365 Lab
  favicon: https://yzhums.com/wp-content/uploads/2020/08/cropped-logo-3-32x32.png
  probed_at: "2026-10-26T06:08:48.779Z"
---

# Dynamics 365 Business Central: How to convert Text/Integer to Date (Text/Integer Data type -> Date Data type)

[Read the post](https://yzhums.com/17631/) · Dynamics 365 Lab - Yun Zhu (Yun Zhu, MVP) · 2026-02-24 · 708 words · tier community · reviewed (checked by Opus)

> This guide demonstrates how to convert Text and Integer data types to Date in Business Central AL development. It covers using the Evaluate method with regional settings, the DMY2Date function with string slicing for fixed formats, and techniques for parsing serialized integers in YYYYMMDD format.

## Key points

- Use System.Evaluate() to parse text strings into Date variables while respecting user regional settings, always wrapping in error handling
- For fixed-format strings like YYYYMMDD, use CopyStr to extract day/month/year components, then DMY2Date() to construct the date
- Integer-to-date conversion requires parsing the integer into separate day, month, and year integers before using DMY2Date(), since integers don't inherently represent dates
- Serialized integers in YYYYMMDD format can be broken apart using either string conversion methods or mathematical division operations

## Quotes

- "It uses the user's regional settings to parse the string. Always wrap it in an if statement to handle formatting errors gracefully." (Essential practice for robust data conversion that respects user localization and prevents runtime errors)
- "If you receive a fixed format (like YYYYMMDD) that doesn't match the user's locale, use CopyStr to break it down" (Provides reliable handling of standardized date formats that differ from user regional settings)

## 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.

- other "SalesOrderExt"

## Context

- Features: System.Evaluate method, System.DMY2Date method, String slicing with CopyStr, Text to Date conversion, Integer to Date conversion, Error handling for date parsing, Locale-aware date formatting

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.
