Exemplo n.º 1
0
 public DateTimeOffset ToDateTimeOffset()
 {
     return(new DateTimeOffset(localDateTime.ToDateTimeUnspecified(), offset.ToTimeSpan()));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Constructs a <see cref="DateTimeOffset"/> value with the same local time and offset from
 /// UTC as this value.
 /// </summary>
 /// <remarks>
 /// An offset does not convey as much information as a time zone; a <see cref="DateTimeOffset"/>
 /// represents an instant in time along with an associated local time, but it doesn't allow you
 /// to find out what the local time would be for another instant.
 /// </remarks>
 /// <returns>A <see cref="DateTimeOffset"/> representation of this value.</returns>
 public DateTimeOffset ToDateTimeOffset()
 {
     return(new DateTimeOffset(LocalInstant.Ticks - NodaConstants.BclEpoch.Ticks, Offset.ToTimeSpan()));
 }