Exemplo n.º 1
0
 public ZonedDateTime PlusTicks(long ticks) => this + Duration.FromTicks(ticks);
Exemplo n.º 2
0
 public Instant PlusTicks(long ticks) => FromUntrustedDuration(duration + Duration.FromTicks(ticks));
Exemplo n.º 3
0
 public OffsetDateTime PlusTicks(long ticks) => this + Duration.FromTicks(ticks);
Exemplo n.º 4
0
 /// <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)));
 }
Exemplo n.º 5
0
 /// <summary>
 /// TO Duration
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 public static Duration AsDuration(this Period p) => Duration.FromTicks(p.Ticks);
Exemplo n.º 6
0
 /// <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)));
 }
Exemplo n.º 7
0
 public Instant PlusTicks(long ticksToAdd) => new Instant(duration + Duration.FromTicks(ticksToAdd));