public ZonedDateTime PlusTicks(long ticks) => this + Duration.FromTicks(ticks);
public Instant PlusTicks(long ticks) => FromUntrustedDuration(duration + Duration.FromTicks(ticks));
public OffsetDateTime PlusTicks(long ticks) => this + Duration.FromTicks(ticks);
/// <summary> /// Initializes a new instance of the <see cref="Instant" /> struct based /// on a number of ticks since the Unix epoch of (ISO) January 1st 1970, midnight, UTC. /// </summary> /// <remarks>This is equivalent to calling the constructor directly, but indicates /// intent more explicitly.</remarks> /// <returns>An <see cref="Instant"/> at exactly the given number of ticks since the Unix epoch.</returns> /// <param name="ticks">Number of ticks since the Unix epoch. May be negative (for instants before the epoch).</param> public static Instant FromUnixTimeTicks(long ticks) { Preconditions.CheckArgumentRange(nameof(ticks), ticks, MinTicks, MaxTicks); return(Instant.FromTrustedDuration(Duration.FromTicks(ticks))); }
/// <summary> /// TO Duration /// </summary> /// <param name="p"></param> /// <returns></returns> public static Duration AsDuration(this Period p) => Duration.FromTicks(p.Ticks);
/// <summary> /// Initializes a new instance of the <see cref="Instant" /> struct based /// on a number of ticks since the Unix epoch of (ISO) January 1st 1970, midnight, UTC. /// </summary> /// <remarks>This is equivalent to calling the constructor directly, but indicates /// intent more explicitly.</remarks> /// <returns>An <see cref="Instant"/> at exactly the given number of ticks since the Unix epoch.</returns> /// <param name="ticks">Number of ticks since the Unix epoch. May be negative (for instants before the epoch).</param> public static Instant FromTicksSinceUnixEpoch(long ticks) { Preconditions.CheckArgumentRange(nameof(ticks), ticks, MinTicks, MaxTicks); return(new Instant(Duration.FromTicks(ticks))); }
public Instant PlusTicks(long ticksToAdd) => new Instant(duration + Duration.FromTicks(ticksToAdd));