How to save dates older than 01/01/1900 in outsystems

How to save dates older than 01/01/1900 in outsystems? Date datatype range starts from 01/01/1900 to 12/31/3000. 

 

Hi 

This is an age old problem. There is no support in OutSystems out of the box as you might have already found out. 

Perhaps you could store them as strings and manipulate using extensions in .NET 

https://docs.microsoft.com/en-us/dotnet/api/system.datetime.minvalue?view=netframework-4.7.2

Solution

Amal Raj wrote:

Hi 

This is an age old problem. There is no support in OutSystems out of the box as you might have already found out. 

Perhaps you could store them as strings and manipulate using extensions in .NET 

https://docs.microsoft.com/en-us/dotnet/api/system.datetime.minvalue?view=netframework-4.7.2

Thanks Amal


Solution

Hi Karthik,

Please check this old post in which i did some testing on limitations of date, the info is in my reply that is marked as solution.

Conclusion #1900-01-01# is the null date BUT NOT the minimum date.

https://www.outsystems.com/forums/discussion/39416/why-can-i-store-a-date-lt-1-1-1900-in-a-date-local-variable/

Regards,

Daniel

The SQL Server date range is January 1, 1753, through December 31, 9999 , that is what one can store in the db i believe. 



Hi All,

Since we are talking about the subject anyone knows why outsystems doesn't use datetime2?

Regards,

Marcelo

Daniël Kuhlmann wrote:

Hi Karthik,

Please check this old post in which i did some testing on limitations of date, the info is in my reply that is marked as solution.

Conclusion #1900-01-01# is the null date BUT NOT the minimum date.

https://www.outsystems.com/forums/discussion/39416/why-can-i-store-a-date-lt-1-1-1900-in-a-date-local-variable/

Regards,

Daniel

Hi Daniël,


I was thinking, if the date 01-01-1900 is a date null but not is the date minim, there is a divergence, because if i need of insert the date 01-01-1900 not will to function.

I think the attribute should to be of type text in this case, right?


Hugs

Eduardo


Hi Eduardo,

You are right that if you need 1-1-1900 as a valid date that you have a problem, that you need to work around.

And a workaround could indeed be to store the date as text in an entity.

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi Eduardo,

You are right that if you need 1-1-1900 as a valid date that you have a problem, that you need to work around.

And a workaround could indeed be to store the date as text in an entity.

Regards,

Daniel

Exactly


Thanks

Eduardo