Question

I am currently stuck at this point where I need to set an xsd element's default attribute to have a valid current date as default. I looked around (googled) but did not find anything convincing. I need to do this in declaratively.

 <xs:element name="UpdatedDate" 
                type="xs: dateTime" 
                msdata:Caption="Updated Date" 
                minOccurs="1" 
                nillable="true" 
                default="DONT KNOW HOW TO GET CURRENT DATE HERE" />

Thanks in Advance

Was it helpful?

Solution

I don't think this is possible. You can define a default value but it has to be fixed value and setting that to current time would make the value change every second.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top