Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFTime Implicit Conversion (DateTime to AFTime)

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFTime Implicit Conversion (DateTime to AFTime)
Implicit cast operator to convert a DateTime to an AFTime.

Namespace:  OSIsoft.AF.Time
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public static implicit operator AFTime (
	DateTime time
)
Public Shared Widening Operator CType ( 
	time As DateTime
) As AFTime

Dim input As DateTime
Dim output As AFTime

output = CType(input, AFTime)
static implicit operator AFTime (
	DateTime time
)
F# does not support the declaration of new casting operators.

Parameters

time
Type: SystemDateTime
The DateTime to be converted.

Return Value

Type: AFTime
Returns a new AFTime created from the specified time parameter.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThrown if the timestamp is between 1/1/1900 and 1/1/1970.

Remarks

Values less than January 1, 1900 will automatically be converted to MinValue. Values between January 1, 1900 and MinValue (January 1, 1970) will generate an ArgumentOutOfRangeException.

Version Information

AFSDK


See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in