Class DateTimeNode
Valued Node representing a Date Time value.
Implements
Inherited Members
Namespace: VDS.RDF.Nodes
Assembly: dotNetRdf.dll
Syntax
public class DateTimeNode : LiteralNode, ILiteralNode, IEquatable<BaseLiteralNode>, IComparable<BaseLiteralNode>, IEquatable<LiteralNode>, IComparable<LiteralNode>, IValuedNode, INode, IComparable<INode>, IComparable<IBlankNode>, IComparable<IGraphLiteralNode>, IComparable<ILiteralNode>, IComparable<IUriNode>, IComparable<IVariableNode>, IComparable<IRefNode>, IComparable<ITripleNode>, IEquatable<INode>, IEquatable<IBlankNode>, IEquatable<IGraphLiteralNode>, IEquatable<ILiteralNode>, IEquatable<IUriNode>, IEquatable<IVariableNode>, IEquatable<IRefNode>, IEquatable<ITripleNode>
Constructors
| Edit this page View SourceDateTimeNode(DateTime)
Creates a new Date Time valued node.
Declaration
public DateTimeNode(DateTime value)
Parameters
Type | Name | Description |
---|---|---|
DateTime | value | Date Time value. |
DateTimeNode(DateTime, DateTimeOffset, string, bool)
Creates a new Date Time valued node.
Declaration
public DateTimeNode(DateTime value, DateTimeOffset offsetValue, string lexicalValue, bool normalizeLiteralValue = false)
Parameters
Type | Name | Description |
---|---|---|
DateTime | value | Date Time value. |
DateTimeOffset | offsetValue | Date Time offset value. |
string | lexicalValue | Lexical Value. |
bool | normalizeLiteralValue | Whether to perform unicode normalization on |
DateTimeNode(DateTime, DateTimeOffset, string, Uri, bool)
Creates a new Date Time valued node.
Declaration
public DateTimeNode(DateTime value, DateTimeOffset offsetValue, string lexicalValue, Uri datatype, bool normalizeLiteralValue = false)
Parameters
Type | Name | Description |
---|---|---|
DateTime | value | Date Time value. |
DateTimeOffset | offsetValue | Date Time offset value. |
string | lexicalValue | Lexical Value. |
Uri | datatype | Data Type URI. |
bool | normalizeLiteralValue | Whether to perform unicode normalization on |
DateTimeNode(DateTime, string, bool)
Creates a new Date Time valued node.
Declaration
public DateTimeNode(DateTime value, string lexicalValue, bool normalizeLiteralValue = false)
Parameters
Type | Name | Description |
---|---|---|
DateTime | value | Date Time value. |
string | lexicalValue | Lexical Value. |
bool | normalizeLiteralValue | Whether to perform unicode normalization on |
DateTimeNode(DateTime, string, Uri, bool)
Creates a new Date Time valued node.
Declaration
protected DateTimeNode(DateTime value, string lexicalValue, Uri datatype, bool normalizeLiteralValue = false)
Parameters
Type | Name | Description |
---|---|---|
DateTime | value | Date Time value. |
string | lexicalValue | Lexical Value. |
Uri | datatype | Datatype URI. |
bool | normalizeLiteralValue | Whether to perform unicode normalization on |
DateTimeNode(DateTime, Uri)
Creates a new Date Time valued node.
Declaration
protected DateTimeNode(DateTime value, Uri datatype)
Parameters
Type | Name | Description |
---|---|---|
DateTime | value | Date Time value. |
Uri | datatype | Datatype URI. |
DateTimeNode(DateTimeOffset)
Creates a new Date Time valued node.
Declaration
public DateTimeNode(DateTimeOffset value)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | value | Date Time value. |
DateTimeNode(DateTimeOffset, string, bool)
Creates a new Date Time valued node.
Declaration
public DateTimeNode(DateTimeOffset value, string lexicalValue, bool normalizeLiteralValue = false)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | value | Date Time value. |
string | lexicalValue | Lexical Value. |
bool | normalizeLiteralValue | Whether to perform unicode normalization on |
DateTimeNode(DateTimeOffset, string, Uri, bool)
Creates a new Date Time valued node.
Declaration
protected DateTimeNode(DateTimeOffset value, string lexicalValue, Uri datatype, bool normalizeLiteralValue = false)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | value | Date Time value. |
string | lexicalValue | Lexical Value. |
Uri | datatype | Datatype URI. |
bool | normalizeLiteralValue | Whether to perform unicode normalization on |
DateTimeNode(DateTimeOffset, Uri)
Creates a new Date Time valued node.
Declaration
protected DateTimeNode(DateTimeOffset value, Uri datatype)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | value | Date Time value. |
Uri | datatype | Datatype URI. |
Properties
| Edit this page View SourceEffectiveType
Gets the URI of the datatype this valued node represents as a String.
Declaration
public string EffectiveType { get; }
Property Value
Type | Description |
---|---|
string |
NumericType
Gets the numeric type of the node.
Declaration
public SparqlNumericType NumericType { get; }
Property Value
Type | Description |
---|---|
SparqlNumericType |
Methods
| Edit this page View SourceAsBoolean()
Throws an error as date times cannot be converted to booleans.
Declaration
public bool AsBoolean()
Returns
Type | Description |
---|---|
bool |
AsDateTime()
Gets the date time value of the node.
Declaration
public DateTime AsDateTime()
Returns
Type | Description |
---|---|
DateTime |
AsDateTimeOffset()
Gets the date time value of the node.
Declaration
public DateTimeOffset AsDateTimeOffset()
Returns
Type | Description |
---|---|
DateTimeOffset |
AsDecimal()
Throws an error as date times cannot be converted to decimals.
Declaration
public decimal AsDecimal()
Returns
Type | Description |
---|---|
decimal |
AsDouble()
Throws an error as date times cannot be converted to doubles.
Declaration
public double AsDouble()
Returns
Type | Description |
---|---|
double |
AsFloat()
Throws an error as date times cannot be converted to floats.
Declaration
public float AsFloat()
Returns
Type | Description |
---|---|
float |
AsInteger()
Throws an error as date times cannot be converted to integers.
Declaration
public long AsInteger()
Returns
Type | Description |
---|---|
long |
AsString()
Gets the date time value as a string.
Declaration
public string AsString()
Returns
Type | Description |
---|---|
string |
AsTimeSpan()
Throws an error as date times cannot be cast to a time span.
Declaration
public TimeSpan AsTimeSpan()
Returns
Type | Description |
---|---|
TimeSpan |