Currently StrToDateTime() accepts only dates before 2027-01-01

I am getting this error on one computer, but not on another computer. What could be causing this difference?


The differenece between the two computers is one is running 6.30.5 and the other is running 6.40.4. The one running 6.40.4 has the error message about strtodatetime

In 6.40.4 I simply added this error message for those passing incorrect strings to StrToDateTime to be aware that they are passing incorrect data. Version 6.30.5 did not display error message but it does not mean it worked. It didn't. It was just silent error.

As error message says, you can only pass strings that cover certain date range to StrToDateTime function.

so after 2027/01/01 I will not be able to use strtodatetime?

I would confirm to TibetanTreeFrog please see this sample and YES AB 6.30.5 does not hint to this message but results equal to 6.40.4 in _TRACE


Str2Date = StrToDateTime("31.12.2026");
_TRACE("Str2Date: " + Str2Date);
Date2Str = DateTimeToStr(Str2Date, 1);
_TRACE("Date2Str: " + Date2Str);

Str2Date = StrToDateTime("01.01.2027");
_TRACE("Str2Date: " + Str2Date);
Date2Str = DateTimeToStr(Str2Date, 1);
_TRACE("Date2Str: " + Date2Str);

Str2Date = StrToDateTime("01.01.2028");
_TRACE("Str2Date: " + Str2Date);
Date2Str = DateTimeToStr(Str2Date, 1);
_TRACE("Date2Str: " + Date2Str);



Thank you very much I realize this is an error, but how can I handle a data greater than 1.01.2027?

Maybe I should rephrase my question.

Will this be updated in the future or should I start using another command because this will no longer work after 01.01.2027?

No. No. No.

Don't run into false conclusions and false assumptions. Why do you guys always assume things that are NEVER said.

Did you read the error message? It says "CURRENTLY". Read the what it is written and don't assume. CURRENTLY means TODAY.

Today is 2022. Yes? And TODAY you can pass dates upto 2027-01-01 into StrToDateTime.
That is state for year 2022.
You have NO REASON to pass TODAY dates beyond 2028 because it is an error. You don't live in the future.

In 2023 you will be able to use dates upto 2028.
In 2024 you will be able to use dates upto 2029.
In 2027 you will be able to use dates upto 2032.
In 2030 you will be able to use dates upto 2035.

FIVE years into the future counting from current year.
For technical reasons DateTime uses RELATIVE dates.

Thank you for that explanation. It is not clear when you see this error that it will always be 5 years counting forward. I was simply entering in Holiday dates and putting them into the future so I do not forget to enter. I knew there was reason! Thanks!

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.