Question
prashanth ponugoti · Mar 17

ERROR while assigning 1800-12-25T00:00:00 to variable type %TimeStamp

Hi Community,

I DTL I am assigning value to %TimeStamp type praport named BirthDate.

 

18001225  converted to 1800-12-25T00:00:00  but giving below error

ERROR #7208: Datatype value '1800-12-25T00:00:00' is not a valid timestamp format
> ERROR #5802: Datatype validation failed on property 'xxx.xxx.xxxx.xxxxx:BirthDate', with value equal to "1800-12-25T00:00:00"

 

20000612   converted to 2000-06-12T00:00:00  is not giving any error

Please help me to resolve this. 

* We did not define the variable type as %TimeStamp   , this persistence class created based on XSD.

 

Thanks 

Prashanth

Product version: IRIS 2020.1
0
0 123
Discussion (3)1
Log in or sign up to continue

By default timestamps are limited  to December 31, 1840, same as horolog.

If you want earlier dates, timestamp property must be defined as:

Property ts As %TimeStamp(MINVAL="0001-01-01 00:00:00.000");

Thanks Eduard for immediate help, still I am getting same error

What does this code return for you:

Class test.ts Extends %Persistent
{

Property ts As %TimeStamp(MINVAL = "0001-01-01 00:00:00.000");

/// do ##class(test.ts).Test()
ClassMethod Test()
{
	set obj = ..%New()
	set obj.ts = "1800-12-25T00:00:00"
	set sc = obj.%Save()
	
	if $$$ISERR(sc) {
		write $System.Status.GetErrorText(sc)
	} else {
		write "Save successful"
	}
}