web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Error message: The value 24.09.2019 00:00:00 cannot be converted to a DateTime.

(0) ShareShare
ReportReport
Posted on by

Hi, guys,
how can I solve the following problem?

The value 24.09.2019 00:00:00 cannot be converted to a DateTime.

What am I doing wrong here?

Here is my code:

LOCAL TextToDateTime(Value : Text) : DateTime
DateTimeAsVariant := DateTimeValue;
IF NOT TypeHelper.Evaluate(DateTimeAsVariant, Value, '', 'en-us') THEN
  ERROR('Der Wert %1 kann nicht in ein DateTime überführt werden', Value);
DateTimeValue := DateTimeAsVariant;
EXIT(DateTimeValue);

I have the same question (0)
  • Verified answer
    Rehan Satti Profile Picture
    636 on at

    Hi Malue,

    You can seprate the string in to data and time and then convert it to datetime variable.

    TestDate := 24.09.2019;

    TestTime :=  00:00:00;

    TestDateTime := CREATEDATETIME(TestDate,TestTime);

    for more details look at the following link

    https://docs.microsoft.com/en-us/dynamics-nav/createdatetime-function--datetime-

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,804 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,103 Super User 2026 Season 1

#3
Kamal Khakhkhar Profile Picture

Kamal Khakhkhar 695

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans