Method | Description | |
---|---|---|
AssertHasDeterministicValue ( this @this ) : void |
Throws an exception if @this.Kind == DateTimeKind.Unspecified.
|
|
SafeToLocalTime ( this @this ) : System.DateTime |
Like DateTime.ToLocalTime except it will throw an exception if @this.Kind == DateTimeKind.Unspecified instead of assuming that Kind == DateTimeKind.Utc and converting based on that assumption like DateTime.ToLocalTime does.
|
|
SafeToUniversalTime ( this @this ) : System.DateTime |
Like DateTime.ToUniversalTime except it will throw an exception if @this.Kind == DateTimeKind.Unspecified instead of assuming that Kind == DateTimeKind.Local and converting based on that assumption like DateTime.ToUniversalTime does.
|
Method | Description | |
---|---|---|
HasDeterministicValue ( this @this ) : bool |
True if @this.Kind != DateTimeKind.Unspecified. If Kind is Unspecified it is not really possible to know which time this represents. It is not possible to schedule an event to take place at this time etc. In order to be able to do so you must know the timezone for a datetime which you only know if it is not Unspecified.
|
public static AssertHasDeterministicValue ( this @this ) : void | ||
@this | this | |
return | void |
public static SafeToLocalTime ( this @this ) : System.DateTime | ||
@this | this | |
return | System.DateTime |
public static SafeToUniversalTime ( this @this ) : System.DateTime | ||
@this | this | |
return | System.DateTime |