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