Class DateTimeWithTimeZone
- Namespace
- Geotab.Checkmate.ObjectModel
- Assembly
- Geotab.Checkmate.ObjectModel.dll
An object with DateTime and TimeZoneInfo.
[Obsolete("Use native DateTimeOffset instead", false)]
public class DateTimeWithTimeZone- Inheritance
- 
      
      DateTimeWithTimeZone
- Inherited Members
Constructors
DateTimeWithTimeZone(in DateTime, TimeZoneInfo)
Initializes a new instance of the DateTimeWithTimeZone class.
public DateTimeWithTimeZone(in DateTime localDateTime, TimeZoneInfo timeZone)Parameters
- localDateTimeDateTime
- The local date time. 
- timeZoneTimeZoneInfo
- The Timezone. 
Properties
LocalDateTime
Gets the local. DateTime
public DateTime LocalDateTime { get; }Property Value
TimeZone
Gets the TimeZoneInfo.
public TimeZoneInfo TimeZone { get; }Property Value
Methods
Equals(object?)
Determines whether the specified object, is equal to this instance.
public override bool Equals(object? obj)Parameters
Returns
FromUtcDateTime(in DateTime, TimeZoneInfo)
Converts the provided UTC DateTime to a time in the provided TimeZoneInfo.
public static DateTime FromUtcDateTime(in DateTime utcDateTime, TimeZoneInfo timeZone)Parameters
- utcDateTimeDateTime
- The UTC date time. 
- timeZoneTimeZoneInfo
- The Timezone. 
Returns
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()Returns
- int
- A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 
ToString()
Returns a string that represents this instance.
public override string ToString()Returns
Operators
implicit operator DateTimeOffset(DateTimeWithTimeZone)
Implicit converter to convert DateTimeWithTimeZone to DateTimeOffset. Created for backwards compatibility.
public static implicit operator DateTimeOffset(DateTimeWithTimeZone zonedTime)Parameters
- zonedTimeDateTimeWithTimeZone
Returns
- DateTimeOffset
- DateTimeOffset equivalent of the provided DateTimeWithTimeZone 
implicit operator DateTimeWithTimeZone(in DateTimeOffset)
Implicit converter to convert DateTimeOffset to DateTimeWithTimeZone. Created for backwards compatibility. The converter converts the DateTimeOffset value into a UTC time, meaning the returned DateTimeWithTimeZone will be in UTC time.
public static implicit operator DateTimeWithTimeZone(in DateTimeOffset zonedTime)Parameters
- zonedTimeDateTimeOffset
Returns
- DateTimeWithTimeZone
- DateTimeWithTimeZone equivalent of the provided DateTimeOffset