SyncronizedEPTDocumentGetMetaFieldAsDateTime Method Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Returns the value, as a DateTime, of a specified Content Studio meta data field that exists for every EPT document.

Namespace: ContentStudio.Document.EPT
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public DateTime GetMetaFieldAsDateTime(
	string fieldName
)

Parameters

fieldName
Type: SystemString
The name of the field. This name must start with "CSMetaDataPrefix or WFMetaDataPrefix.

Return Value

Type: DateTime
The value of the field if found, MinValue if the field does not exist.
Exceptions

ExceptionCondition
ArgumentNullExceptionThe argument FieldName cannot be null.
ArgumentExceptionThe argument FieldName must start with either CSMetaDataPrefix or WFMetaDataPrefix.
FormatExceptionThe value does not contain a valid string representation of a date and time.
Remarks

This method returns MinValue if schema binding is off and for documents created with this class even if they are saved and published. In order to read the meta data fields given for a created document you must reload it.
The string s is parsed using the formatting information in a DateTimeFormatInfo initialized for the current culture. This method attempts to parse s completely and avoid throwing FormatException. It ignores unrecognized data if possible and fills in missing month, day, and year information with the current time. If s contains only a date and no time, this method assumes 12:00 midnight. Any leading, inner, or trailing white space character in s is ignored. The date and time can be bracketed with a pair of leading and trailing NUMBER SIGN characters ('#', U+0023), and can be trailed with one or more NULL characters (U+0000).
This remark is an excerpt from the MSDN documentation.
See Also

Reference